Chromium Code Reviews
Help | Chromium Project | Gerrit Changes | Sign in
(1)

Issue 1192363005: Move all clip display item parameters to the constructor (Closed)

Created:
4 years, 10 months ago by pdr.
Modified:
4 years, 10 months ago
Reviewers:
chrishtr
CC:
blink-reviews, blink-reviews-paint_chromium.org, Rik, danakj, dshwang, drott+blinkwatch_chromium.org, krit, f(malita), Justin Novosad, pdr+graphicswatchlist_chromium.org, rwlbuis, Stephen Chennney, slimming-paint-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Move all clip display item parameters to the constructor This patch changes ClipDisplayItem to take all rounded rects in through the constructor. Because rounded rects are rarer than regular clips, the rounded rects are now heap allocated. If this becomes a problem in the future we may want to factor out a RoundedClipsDisplayItem. No new tests as there should be no change in behavior. BUG=484943 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=197515

Patch Set 1 #

Total comments: 1

Patch Set 2 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+42 lines, -27 lines) Patch
M Source/core/paint/BoxClipper.cpp View 1 chunk +7 lines, -6 lines 0 comments Download
M Source/core/paint/LayerClipRecorder.cpp View 1 chunk +7 lines, -3 lines 0 comments Download
M Source/core/paint/RoundedInnerRectClipper.cpp View 1 chunk +7 lines, -7 lines 0 comments Download
M Source/platform/graphics/paint/ClipDisplayItem.h View 1 2 chunks +5 lines, -6 lines 0 comments Download
M Source/platform/graphics/paint/ClipDisplayItem.cpp View 1 2 chunks +16 lines, -5 lines 0 comments Download

Messages

Total messages: 14 (5 generated)
pdr.
PTAL The diffs are a little hard to read because this patch depends on https://codereview.chromium.org/1198583003 ...
4 years, 10 months ago (2015-06-19 22:07:39 UTC) #2
chrishtr
https://codereview.chromium.org/1192363005/diff/1/Source/core/paint/BoxClipper.cpp File Source/core/paint/BoxClipper.cpp (right): https://codereview.chromium.org/1192363005/diff/1/Source/core/paint/BoxClipper.cpp#newcode57 Source/core/paint/BoxClipper.cpp:57: roundedRects = adoptPtr(new Vector<FloatRoundedRect>()); How about putting the vector ...
4 years, 10 months ago (2015-06-19 22:10:17 UTC) #3
pdr.
On 2015/06/19 at 22:10:17, chrishtr wrote: > https://codereview.chromium.org/1192363005/diff/1/Source/core/paint/BoxClipper.cpp > File Source/core/paint/BoxClipper.cpp (right): > > https://codereview.chromium.org/1192363005/diff/1/Source/core/paint/BoxClipper.cpp#newcode57 ...
4 years, 10 months ago (2015-06-19 23:23:37 UTC) #4
chrishtr
lgtm
4 years, 10 months ago (2015-06-19 23:24:35 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1192363005/1
4 years, 10 months ago (2015-06-19 23:25:07 UTC) #7
commit-bot: I haz the power
Try jobs failed on following builders: mac_blink_rel on tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/mac_blink_rel/builds/59891)
4 years, 10 months ago (2015-06-19 23:28:25 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1192363005/20001
4 years, 10 months ago (2015-06-19 23:50:39 UTC) #12
commit-bot: I haz the power
Committed patchset #2 (id:20001) as https://src.chromium.org/viewvc/blink?view=rev&revision=197515
4 years, 10 months ago (2015-06-20 01:18:42 UTC) #13
jbroman
4 years, 10 months ago (2015-06-29 11:51:40 UTC) #14
Message was sent while issue was closed.
On 2015/06/19 23:23:37, pdr wrote:
> On 2015/06/19 at 22:10:17, chrishtr wrote:
> >
>
https://codereview.chromium.org/1192363005/diff/1/Source/core/paint/BoxClippe...
> > File Source/core/paint/BoxClipper.cpp (right):
> > 
> >
>
https://codereview.chromium.org/1192363005/diff/1/Source/core/paint/BoxClippe...
> > Source/core/paint/BoxClipper.cpp:57: roundedRects = adoptPtr(new
> Vector<FloatRoundedRect>());
> > How about putting the vector on the stack, and requiring the argument? Then
> pass by value to copy the vector elements.
> 
> Chris and I discussed this in person. It's hard to do this because Vectors
> themselves have a heap allocated arena so we end up doing two mallocs either
> way. Because rounded rects aren't the common case, we think this may be the
best
> approach after all.
> 
> PTAL

At the risk of retroactive review (sorry): mind clarifying what you mean by
this?
Vector<Element> is analogous to OwnPtr<Element[]>, so having OwnPtr<Vector<Foo>>
seems weirdly indirect to me.

Vector shouldn't heap-allocate a buffer when it is default-constructed and empty
(all it should do is set three fields to zero, IIRC), and Vector::swap lets you
swap out the underlying buffer pointer, size and capacity. The usual (pre-move)
pattern is:

Vector<Foo> foos;
// add foos
new FooConsumer(foos);

fooConsumer::FooConsumer(Vector<Foo>& foos)
{
    m_foos.swap(foos);
}

When there are no foos, this should require only the heap allocation used to
construct FooConsumer.

Powered by Google App Engine
This is Rietveld 408576698