[webkit-reviews] review granted: [Bug 195743] Optimize Region for single rectangle case : [Attachment 364659] patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Mar 14 08:57:05 PDT 2019
Simon Fraser (smfr) <simon.fraser at apple.com> has granted Antti Koivisto
<koivisto at iki.fi>'s request for review:
Bug 195743: Optimize Region for single rectangle case
https://bugs.webkit.org/show_bug.cgi?id=195743
Attachment 364659: patch
https://bugs.webkit.org/attachment.cgi?id=364659&action=review
--- 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.
More information about the webkit-reviews
mailing list