Skip to content
This repository has been archived by the owner on Jul 18, 2018. It is now read-only.

Commit

Permalink
[SPv2] Force new chunk at the end of a subsequence
Browse files Browse the repository at this point in the history
This is a follow-up of https://chromium-review.googlesource.com/c/525139/
which forced new chunk at the beginning of a subsequence.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I8c2f750f1bc08ef89c728d1413a51d8af03ec03a
Reviewed-on: https://chromium-review.googlesource.com/556265
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#483901}
  • Loading branch information
wangxianzhu authored and Commit Bot committed Jul 1, 2017
1 parent 3668e4d commit aa841d0
Show file tree
Hide file tree
Showing 15 changed files with 331 additions and 350 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
"reason": "appeared"
},
{
"object": "LayoutImage IMG",
"object": "LayoutBlockFlow (relative positioned) DIV class='relative paddingTop'",
"rect": [58, 236, 489, 537],
"reason": "geometry"
"reason": "appeared"
},
{
"object": "LayoutImage IMG",
"rect": [58, 142, 489, 537],
"reason": "geometry"
"reason": "disappeared"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
"reason": "disappeared"
},
{
"object": "LayoutImage IMG",
"object": "LayoutBlockFlow (relative positioned) DIV class='relative paddingTop'",
"rect": [58, 241, 489, 537],
"reason": "geometry"
"reason": "disappeared"
},
{
"object": "LayoutImage IMG",
"rect": [58, 142, 489, 537],
"reason": "geometry"
"reason": "appeared"
}
]
}
Expand Down
40 changes: 18 additions & 22 deletions third_party/WebKit/Source/core/paint/PaintControllerPaintTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,28 +124,24 @@ class TestDisplayItem final : public DisplayItem {
}
};

#ifndef NDEBUG
#define TRACE_DISPLAY_ITEMS(i, expected, actual) \
String trace = String::Format("%d: ", (int)i) + \
"Expected: " + (expected).AsDebugString() + \
" Actual: " + (actual).AsDebugString(); \
SCOPED_TRACE(trace.Utf8().data());
#else
#define TRACE_DISPLAY_ITEMS(i, expected, actual)
#endif

#define EXPECT_DISPLAY_LIST(actual, expectedSize, ...) \
do { \
EXPECT_EQ((size_t)expectedSize, actual.size()); \
if (expectedSize != actual.size()) \
break; \
const TestDisplayItem expected[] = {__VA_ARGS__}; \
for (size_t index = 0; \
index < std::min<size_t>(actual.size(), expectedSize); index++) { \
TRACE_DISPLAY_ITEMS(index, expected[index], actual[index]); \
EXPECT_EQ(expected[index].Client(), actual[index].Client()); \
EXPECT_EQ(expected[index].GetType(), actual[index].GetType()); \
} \
#define EXPECT_DISPLAY_LIST(actual, expected_size, ...) \
do { \
EXPECT_EQ((size_t)expected_size, actual.size()); \
if (expected_size != actual.size()) \
break; \
const TestDisplayItem expected[] = {__VA_ARGS__}; \
for (size_t i = 0; i < expected_size; ++i) { \
SCOPED_TRACE( \
String::Format("%d: Expected:(client=%p:\"%s\" type=%d) " \
"Actual:(client=%p:%s type=%d)", \
(int)i, &expected[i].Client(), \
expected[i].Client().DebugName().Ascii().data(), \
(int)expected[i].GetType(), &actual[i].Client(), \
actual[i].Client().DebugName().Ascii().data(), \
(int)actual[i].GetType())); \
EXPECT_EQ(&expected[i].Client(), &actual[i].Client()); \
EXPECT_EQ(expected[i].GetType(), actual[i].GetType()); \
} \
} while (false);

// Shorter names for frequently used display item types in tests.
Expand Down
7 changes: 2 additions & 5 deletions third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -524,11 +524,8 @@ PaintResult PaintLayerPainter::PaintLayerContents(
properties.property_tree_state = *local_border_box_properties;
properties.backface_hidden =
paint_layer_.GetLayoutObject().HasHiddenBackface();
content_scoped_paint_chunk_properties.emplace(
context.GetPaintController(), paint_layer_, properties,
// Force a new paint chunk, since it is required for subsequence
// caching.
should_create_subsequence ? kForceNewChunk : kDontForceNewChunk);
content_scoped_paint_chunk_properties.emplace(context.GetPaintController(),
paint_layer_, properties);
}

bool selection_only =
Expand Down
Loading

0 comments on commit aa841d0

Please sign in to comment.