[Webkit-unassigned] [Bug 195743] Optimize Region for single rectangle case
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Mar 14 08:57:05 PDT 2019
https://bugs.webkit.org/show_bug.cgi?id=195743
Simon Fraser (smfr) <simon.fraser at apple.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #364659|review? |review+
Flags| |
--- Comment #3 from Simon Fraser (smfr) <simon.fraser at apple.com> ---
Comment on attachment 364659
--> https://bugs.webkit.org/attachment.cgi?id=364659
patch
View in context: https://bugs.webkit.org/attachment.cgi?id=364659&action=review
> Source/WebCore/platform/graphics/Region.cpp:60
> +Region::~Region()
= default
> Source/WebCore/platform/graphics/Region.cpp:85
> + if (!m_bounds.isEmpty())
> + rects.append(m_bounds);
> + return rects;
Since this is the common case, maybe reserveInitialCapacity(1) and uncheckedAppend here, avoiding wasted vector capacity.
> Source/WebCore/platform/graphics/Region.h:189
> + return a.m_bounds == b.m_bounds && arePointingToEqualData(a.m_shape, b.m_shape);
very nice
> Source/WebCore/platform/graphics/Region.h:226
> + Optional<size_t> segmentIndex;
> + decoder >> segmentIndex;
I don't really find this use of Optional<> and decoder >> much clearer than testing for decode success directly.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190314/d33f54a5/attachment.html>
More information about the webkit-unassigned
mailing list