https://codereview.chromium.org/1379883003/diff/100001/third_party/WebKit/Source/platform/graphics/paint/PaintChunk.h
File third_party/WebKit/Source/platform/graphics/paint/PaintChunk.h
(right):
https://codereview.chromium.org/1379883003/diff/100001/third_party/WebKit/Source/platform/graphics/paint/PaintChunk.h#newcode15
third_party/WebKit/Source/platform/graphics/paint/PaintChunk.h:15: //
This is expected to be owned by the paint artifact which also owns the
On 2015/10/01 at 00:32:48, pdr wrote:
> May want to update this, depending on the discussion below in
README.md
?
https://codereview.chromium.org/1379883003/diff/100001/third_party/WebKit/Source/platform/graphics/paint/PaintChunk.h#newcode18
third_party/WebKit/Source/platform/graphics/paint/PaintChunk.h:18: //
This is a Slimming Paint v2 class.
On 2015/10/01 at 00:32:48, pdr wrote:
> Lets replace this with proof in the form of an assert in the ctors :)
It seems weird to have a data object asserting the state of the world.
I'll do it if you ask again.
I have added such assertions to PaintChunker methods which modify the
chunks vector.
https://codereview.chromium.org/1379883003/diff/100001/third_party/WebKit/Source/platform/graphics/paint/PaintChunker.cpp
File third_party/WebKit/Source/platform/graphics/paint/PaintChunker.cpp
(right):
https://codereview.chromium.org/1379883003/diff/100001/third_party/WebKit/Source/platform/graphics/paint/PaintChunker.cpp#newcode18
third_party/WebKit/Source/platform/graphics/paint/PaintChunker.cpp:18:
void PaintChunker::updateCurrentPaintProperties(const PaintProperties&
properties)
On 2015/10/01 at 02:19:36, trchen wrote:
> I think we can improve this a little bit.
> IMO we should have a m_currentProperties. Whenever a new display item
is emitted, we check if m_currentProperties is the same as the last
chunk, if yes, append to the last chunk, otherwise create a new chunk.
It will probably perform better with case like this:
> <draw/><clip></clip><draw/>
> So both drawing can share a chunk without being interrupted by a no-op
clip.
I'd have expected that case to be rare, because Blink does have logic to
avoid emitting clips where no content would be clipped:
https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/core/paint/BoxClipper.cpp&l=38
I'm a little worried that the complexity will hurt
incrementDisplayItemIndex's cost, but not too worried. So sure, done.
https://codereview.chromium.org/1379883003/diff/100001/third_party/WebKit/Source/platform/graphics/paint/PaintChunker.h
File third_party/WebKit/Source/platform/graphics/paint/PaintChunker.h
(right):
https://codereview.chromium.org/1379883003/diff/100001/third_party/WebKit/Source/platform/graphics/paint/PaintChunker.h#newcode36
third_party/WebKit/Source/platform/graphics/paint/PaintChunker.h:36:
PaintChunk m_newChunk;
On 2015/10/01 at 00:32:48, pdr wrote:
> Is there a reason for not putting this as the last item in m_chunks?
This approach isn't bad, just curious if we could remove the need for an
"initial state" concept (and the empty PaintChunk ctor) in favor of
explicitly tracking it with a bool.
Changed to trchen's suggestion. (I did this because it seemed simplest.)
https://codereview.chromium.org/1379883003/diff/100001/third_party/WebKit/Source/platform/graphics/paint/PaintChunkerTest.cpp
File
third_party/WebKit/Source/platform/graphics/paint/PaintChunkerTest.cpp
(right):
https://codereview.chromium.org/1379883003/diff/100001/third_party/WebKit/Source/platform/graphics/paint/PaintChunkerTest.cpp#newcode38
third_party/WebKit/Source/platform/graphics/paint/PaintChunkerTest.cpp:38:
EXPECT_THAT(toStdVector(chunks), ElementsAre(
On 2015/10/01 at 00:32:48, pdr wrote:
> This expect_that elementsAre pattern is cool.
Yeah, GMock is awesome. Better yet, the arguments can be arbitrary
matchers.
https://codereview.chromium.org/1379883003/diff/100001/third_party/WebKit/Source/platform/graphics/paint/README.md
File third_party/WebKit/Source/platform/graphics/paint/README.md
(right):
https://codereview.chromium.org/1379883003/diff/100001/third_party/WebKit/Source/platform/graphics/paint/README.md#newcode18
third_party/WebKit/Source/platform/graphics/paint/README.md:18: ## Paint
artifact
On 2015/10/01 at 00:32:48, pdr wrote:
> Because the display item list will require intimate knowledge of the
paint chunks (for merge), I think we'll end up using DIL as the paint
artifact. Is that your thinking too, or do you think we can extract the
merge logic out of the list into a paint artifact class? Alternatively,
rename DisplayItemList to PaintArtifact and create a simple wrapper
around a vector of display items?
In my ideal world, DisplayItemList would become something like
PaintArtifactBuilder, to reflect that its role is the stateful work of
constructing new paint artifacts (including keeping around the old one),
and one would use PaintArtifactBuilder::paintArtifact() to get access to
the latest artifact, which would be a { chunks, drawings } class.
blink::DIL is currently much more than a single list, and the name
suggests more similarity to cc::DisplayItemList than there is (the
latter is closer to blink::DisplayItems).
I'm not upper-casing it here, because the current "artifact" is
currently called DisplayItemList::displayItems(), but this is how I
think of it.
https://codereview.chromium.org/1379883003/diff/100001/third_party/WebKit/Source/platform/graphics/paint/README.md#newcode21
third_party/WebKit/Source/platform/graphics/paint/README.md:21: all
drawings), partitioned into *paint chunks* which define certain certain
On 2015/10/01 at 00:32:48, pdr wrote:
> Nit: remove either the first or the second certain
Done.
https://codereview.chromium.org/1379883003/diff/100001/third_party/WebKit/Source/platform/graphics/paint/README.md#newcode62
third_party/WebKit/Source/platform/graphics/paint/README.md:62: ***
On 2015/10/01 at 02:19:36, trchen wrote:
> AFAIK the uniqueness is not enforced for metadata display items, but
for drawing display items they are required to be unique for caching to
work.
Changed to drawings.
https://codereview.chromium.org/1379883003/diff/100001/third_party/WebKit/Source/platform/graphics/paint/README.md#newcode65
third_party/WebKit/Source/platform/graphics/paint/README.md:65: emit
display items to a `GraphicsContext`.
On 2015/10/01 at 00:32:48, pdr wrote:
> GraphicsContext -> DisplayItemList ?
Well, it's a little weird, because you actually pass the GraphicsContext
to the recorder classes, which pull out the DisplayItemList. Reworded a
little, though I'm not sure it helps.
https://codereview.chromium.org/1379883003/diff/100001/third_party/WebKit/Source/platform/graphics/paint/README.md#newcode71
third_party/WebKit/Source/platform/graphics/paint/README.md:71: If the
type is `DisplayItem::CachedSubsequence`, indicates that the previous
On 2015/10/01 at 00:32:48, pdr wrote:
> Nit: "The type `DisplayItem::CachedSubsequence` indicates that the
previous..."
Done.
https://codereview.chromium.org/1379883003/diff/100001/third_party/WebKit/Source/platform/graphics/paint/README.md#newcode79
third_party/WebKit/Source/platform/graphics/paint/README.md:79:
Otherwise, indicates that it contains a single `DrawingDisplayItem` with
a
On 2015/10/01 at 00:32:48, pdr wrote:
> Nit: "Other cached display items reference a single
`DrawingDisplayIetm` with..."
Done.
https://codereview.chromium.org/1379883003/diff/100001/third_party/WebKit/Source/platform/graphics/paint/README.md#newcode96
third_party/WebKit/Source/platform/graphics/paint/README.md:96:
`GraphicsContext` is used to record into a `DisplayItemList`, which is
On 2015/10/01 at 00:32:48, pdr wrote:
> I don't quite follow the GraphicsContext reference here. Could you
expand on that a bit?
Expanded a little.
https://codereview.chromium.org/1379883003/diff/100001/third_party/WebKit/Source/platform/graphics/paint/SubsequenceRecorder.cpp
File
third_party/WebKit/Source/platform/graphics/paint/SubsequenceRecorder.cpp
(right):
https://codereview.chromium.org/1379883003/diff/100001/third_party/WebKit/Source/platform/graphics/paint/SubsequenceRecorder.cpp#newcode23
third_party/WebKit/Source/platform/graphics/paint/SubsequenceRecorder.cpp:23:
// TODO(jbroman): When SPv2 paint property code can handle it, don't
skip
On 2015/10/01 at 00:32:48, pdr wrote:
> I think we should hold off on turning off subsequences for now, since
Xianzhu is still working on them a bit and it'll require updating a
bunch of tests. Instead, lets just rely on your comment in
commitNewDisplayItems.
Done.
https://codereview.chromium.org/1379883003/