Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Issue 1390933003: Implement the framework for the paint property hierarchy (Closed)

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

Description

Implement the framework for the paint property hierarchy This patch implements the framework for generating paint property trees in blink. Paint properties represent the transforms, clips, scroll relationships, and effects that a LayoutObject produces, and these properties are used to create PaintChunks which are potential compositing triggers. The primary document covering this approach is: https://docs.google.com/document/d/12I3JD1-Jmnb59ZHKyntFTSsNUzQhPae8QpCECtZt5zs Updating the paint properties is done during the UpdatePaintProperties phase and only during this phase can the properties be modified. During paint, properties can be easily accessed since LayoutObjects store the properties. Changes in properties are tracked using the PaintChunker and emitted onto the PaintArtifact. This patch does not contain the walk that actually generates the paint property trees, nor the paint step to generate paint chunks. BUG=537409

Patch Set 1 #

Total comments: 15
Unified diffs Side-by-side diffs Delta from patch set Stats (+323 lines, -37 lines) Patch
M third_party/WebKit/Source/core/core.gypi View 1 chunk +1 line, -0 lines 0 comments Download
A third_party/WebKit/Source/core/paint/ObjectPaintProperties.h View 1 chunk +38 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/paint/PaintLayer.h View 3 chunks +10 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/paint/PaintLayer.cpp View 2 chunks +15 lines, -0 lines 2 comments Download
M third_party/WebKit/Source/platform/blink_platform.gypi View 2 chunks +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/CompositedDisplayList.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/ContentLayerDelegate.h View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/ContentLayerDelegate.cpp View 3 chunks +4 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/GraphicsLayer.h View 5 chunks +8 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp View 3 chunks +7 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/paint/DisplayItemList.h View 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/paint/DisplayItemTransformTree.h View 1 chunk +1 line, -0 lines 1 comment Download
A third_party/WebKit/Source/platform/graphics/paint/PaintArtifact.h View 1 chunk +46 lines, -0 lines 1 comment Download
A third_party/WebKit/Source/platform/graphics/paint/PaintArtifact.cpp View 1 chunk +16 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/paint/PaintChunkerTest.cpp View 3 chunks +60 lines, -10 lines 3 comments Download
M third_party/WebKit/Source/platform/graphics/paint/PaintProperties.h View 1 chunk +12 lines, -7 lines 0 comments Download
A third_party/WebKit/Source/platform/graphics/paint/TransformPaintProperty.h View 1 chunk +55 lines, -0 lines 6 comments Download
M third_party/WebKit/Source/platform/testing/PaintPrinters.h View 2 chunks +2 lines, -0 lines 2 comments Download
M third_party/WebKit/Source/platform/testing/PaintPrinters.cpp View 2 chunks +40 lines, -1 line 0 comments Download

Messages

Total messages: 4 (1 generated)
pdr.
PTAL I'd like to split this up but wanted to show the full patch which ...
5 years, 2 months ago (2015-10-07 05:36:29 UTC) #2
jbroman
Seems reasonable to me at a high level (this isn't a super detailed review yet). ...
5 years, 2 months ago (2015-10-07 15:22:23 UTC) #3
pdr.
5 years, 2 months ago (2015-10-07 20:19:11 UTC) #4
Updated and uploaded just the paint property bits at
https://codereview.chromium.org/1397583002.

@Jeremy, per our discussion at the paint propz meeting, please steal the
PaintArtifacts from this patch

https://codereview.chromium.org/1390933003/diff/1/third_party/WebKit/Source/c...
File third_party/WebKit/Source/core/paint/PaintLayer.cpp (right):

https://codereview.chromium.org/1390933003/diff/1/third_party/WebKit/Source/c...
third_party/WebKit/Source/core/paint/PaintLayer.cpp:2718: void
PaintLayer::setPaintProperties(PassOwnPtr<ObjectPaintProperties>
paintProperties)
On 2015/10/07 at 15:22:22, jbroman wrote:
> nit: I'd rather the caller be able to update the existing
ObjectPaintProperties instance (e.g. using the rare-data ensurePaintProperties()
pattern or similar), to avoid doing a ton of alloc/dealloc pairs when updating
these.
> 
> This might be premature optimization, so we can leave this to later if you'd
prefer.

Done. Changed to non-const mutablePaintProperties() and const paintProperties().

https://codereview.chromium.org/1390933003/diff/1/third_party/WebKit/Source/p...
File third_party/WebKit/Source/platform/graphics/paint/PaintChunkerTest.cpp
(right):

https://codereview.chromium.org/1390933003/diff/1/third_party/WebKit/Source/p...
third_party/WebKit/Source/platform/graphics/paint/PaintChunkerTest.cpp:132: //
TODO(pdr): Add more tests once we have more paint properties.
On 2015/10/07 at 15:22:22, jbroman wrote:
> I'd also like tests for the case that trchen mentioned, where two ranges with
the same paint properties are interrupted by a range with different properties
but no items. i.e.
> 
> updateCurrentPaintProperties(a);
> incrementDisplayItemIndex();
> updateCurrentPaintProperties(b);
> updateCurrentPaintProperties(a);
> incrementDisplayItemIndex();
> EXPECT_THAT(there is one chunk with 2 items and properties a);
> 
> I'd have added it before, but I couldn't create unequal properties.

Done

https://codereview.chromium.org/1390933003/diff/1/third_party/WebKit/Source/p...
File third_party/WebKit/Source/platform/graphics/paint/TransformPaintProperty.h
(right):

https://codereview.chromium.org/1390933003/diff/1/third_party/WebKit/Source/p...
third_party/WebKit/Source/platform/graphics/paint/TransformPaintProperty.h:22:
class PLATFORM_EXPORT TransformPaintProperty : public
RefCounted<TransformPaintProperty> {
On 2015/10/07 at 15:22:22, jbroman wrote:
> nit: Having "node" in this would suggest hierarchy more to me, like
"PaintTransformNode", but I don't want to bikeshed this too much.

Changed to TransformPaintPropertyNode. I wanted to keep the name "PaintProperty"
here to minimize confusion when layout folks see this hanging off their tree.

https://codereview.chromium.org/1390933003/diff/1/third_party/WebKit/Source/p...
third_party/WebKit/Source/platform/graphics/paint/TransformPaintProperty.h:28:
Perspective
On 2015/10/07 at 15:22:22, jbroman wrote:
> Hmm. Ideally this distinction wouldn't leak into platform/ explicitly. Can we
contain this to core/? Does platform/ use it for anything?

We can remove this for now, but it may be needed (as an opaque id) to support
subsequences in the future.

https://codereview.chromium.org/1390933003/diff/1/third_party/WebKit/Source/p...
third_party/WebKit/Source/platform/graphics/paint/TransformPaintProperty.h:31:
TransformPaintProperty(const Type type, const TransformationMatrix& matrix,
const FloatPoint3D& origin, PassRefPtr<TransformPaintProperty> parent = nullptr)
On 2015/10/07 at 15:22:22, jbroman wrote:
> nit: taking arguments by const value is weird; just "Type" works (you wouldn't
take "const int")

Fixed. For some reason this reminded me of the awesome MPAA piracy campaign "You
wouldn't download a car" https://pbs.twimg.com/media/A-DoMcjCMAA8rr9.jpg.

https://codereview.chromium.org/1390933003/diff/1/third_party/WebKit/Source/p...
File third_party/WebKit/Source/platform/testing/PaintPrinters.h (right):

https://codereview.chromium.org/1390933003/diff/1/third_party/WebKit/Source/p...
third_party/WebKit/Source/platform/testing/PaintPrinters.h:29: void
PrintTo(const TransformationPaintProperty&, std::ostream*);
On 2015/10/07 at 15:22:22, jbroman wrote:
> TransformPaintProperty and TransformationMatrix as separate entries, not
TransformationPaintProperty (here and above)

Surprised this compiled.

Powered by Google App Engine
This is Rietveld 408576698