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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintControllerPaintTest.cpp

Issue 2698673007: Only create PaintChunks at drawing and foreignLayer boundaries (Closed)
Patch Set: Great expectations Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/PaintControllerPaintTest.h" 5 #include "core/paint/PaintControllerPaintTest.h"
6 6
7 #include "core/editing/FrameCaret.h" 7 #include "core/editing/FrameCaret.h"
8 #include "core/editing/FrameSelection.h" 8 #include "core/editing/FrameSelection.h"
9 #include "core/layout/LayoutText.h" 9 #include "core/layout/LayoutText.h"
10 #include "core/layout/line/InlineTextBox.h" 10 #include "core/layout/line/InlineTextBox.h"
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 } 228 }
229 229
230 // Verify that the background does not scroll. 230 // Verify that the background does not scroll.
231 const PaintChunk& backgroundChunk = rootPaintController().paintChunks()[0]; 231 const PaintChunk& backgroundChunk = rootPaintController().paintChunks()[0];
232 EXPECT_FALSE(backgroundChunk.properties.propertyTreeState.transform() 232 EXPECT_FALSE(backgroundChunk.properties.propertyTreeState.transform()
233 ->isScrollTranslation()); 233 ->isScrollTranslation());
234 234
235 const EffectPaintPropertyNode* effectNode = div.paintProperties()->effect(); 235 const EffectPaintPropertyNode* effectNode = div.paintProperties()->effect();
236 EXPECT_EQ(0.5f, effectNode->opacity()); 236 EXPECT_EQ(0.5f, effectNode->opacity());
237 237
238 // When RLS is enabled, an additional paint chunk will be created for the 238 const PaintChunk& chunk = rootPaintController().paintChunks()[1 /* div */];
239 // LayoutView's layer.
240 unsigned divChunkIndex =
241 RuntimeEnabledFeatures::rootLayerScrollingEnabled() ? 2 : 1;
242 const PaintChunk& chunk = rootPaintController().paintChunks()[divChunkIndex];
243 EXPECT_EQ(*div.layer(), chunk.id->client); 239 EXPECT_EQ(*div.layer(), chunk.id->client);
244 EXPECT_EQ(effectNode, chunk.properties.propertyTreeState.effect()); 240 EXPECT_EQ(effectNode, chunk.properties.propertyTreeState.effect());
245 241
246 EXPECT_FALSE(div.layer()->isJustCreated()); 242 EXPECT_FALSE(div.layer()->isJustCreated());
247 // Client used by only paint chunks and non-cachaeable display items but not 243 // Client used by only paint chunks and non-cachaeable display items but not
248 // by any cacheable display items won't be marked as validly cached. 244 // by any cacheable display items won't be marked as validly cached.
249 EXPECT_FALSE(rootPaintController().clientCacheIsValid(*div.layer())); 245 EXPECT_FALSE(rootPaintController().clientCacheIsValid(*div.layer()));
250 EXPECT_FALSE(rootPaintController().clientCacheIsValid(div)); 246 EXPECT_FALSE(rootPaintController().clientCacheIsValid(div));
251 EXPECT_TRUE(rootPaintController().clientCacheIsValid(subDiv)); 247 EXPECT_TRUE(rootPaintController().clientCacheIsValid(subDiv));
252 } 248 }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 TestDisplayItem(div, DisplayItem::kEndCompositing), 283 TestDisplayItem(div, DisplayItem::kEndCompositing),
288 TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence), 284 TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence),
289 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence), 285 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence),
290 TestDisplayItem(layoutView(), 286 TestDisplayItem(layoutView(),
291 DisplayItem::clipTypeToEndClipType( 287 DisplayItem::clipTypeToEndClipType(
292 DisplayItem::kClipFrameToVisibleContentRect))); 288 DisplayItem::kClipFrameToVisibleContentRect)));
293 } 289 }
294 } 290 }
295 291
296 } // namespace blink 292 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698