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

Side by Side Diff: Source/core/paint/LayerClipRecorderTest.cpp

Issue 1193433004: Blink-side contiguous allocation of display items. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add ListContainer::AllocateAndConstructWithArguments and a TODO in DisplayItemList::findMatchingIte… Created 5 years, 5 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 "config.h" 5 #include "config.h"
6 #include "core/paint/LayerClipRecorder.h" 6 #include "core/paint/LayerClipRecorder.h"
7 7
8 #include "core/layout/LayoutTestHelper.h" 8 #include "core/layout/LayoutTestHelper.h"
9 #include "core/layout/LayoutView.h" 9 #include "core/layout/LayoutView.h"
10 #include "core/layout/compositing/DeprecatedPaintLayerCompositor.h" 10 #include "core/layout/compositing/DeprecatedPaintLayerCompositor.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 TEST_F(LayerClipRecorderTest, Single) 68 TEST_F(LayerClipRecorderTest, Single)
69 { 69 {
70 GraphicsContext context(&rootDisplayItemList()); 70 GraphicsContext context(&rootDisplayItemList());
71 FloatRect bound = layoutView().viewRect(); 71 FloatRect bound = layoutView().viewRect();
72 EXPECT_EQ((size_t)0, rootDisplayItemList().displayItems().size()); 72 EXPECT_EQ((size_t)0, rootDisplayItemList().displayItems().size());
73 73
74 drawRectInClip(context, layoutView(), PaintPhaseForeground, bound); 74 drawRectInClip(context, layoutView(), PaintPhaseForeground, bound);
75 rootDisplayItemList().commitNewDisplayItems(); 75 rootDisplayItemList().commitNewDisplayItems();
76 EXPECT_EQ((size_t)3, rootDisplayItemList().displayItems().size()); 76 EXPECT_EQ((size_t)3, rootDisplayItemList().displayItems().size());
77 EXPECT_TRUE(DisplayItem::isClipType(rootDisplayItemList().displayItems()[0]. type())); 77 EXPECT_TRUE(DisplayItem::isClipType(rootDisplayItemList().displayItems().ele mentAt(0)->type()));
78 EXPECT_TRUE(DisplayItem::isDrawingType(rootDisplayItemList().displayItems()[ 1].type())); 78 EXPECT_TRUE(DisplayItem::isDrawingType(rootDisplayItemList().displayItems(). elementAt(1)->type()));
79 EXPECT_TRUE(DisplayItem::isEndClipType(rootDisplayItemList().displayItems()[ 2].type())); 79 EXPECT_TRUE(DisplayItem::isEndClipType(rootDisplayItemList().displayItems(). elementAt(2)->type()));
80 } 80 }
81 81
82 TEST_F(LayerClipRecorderTest, Empty) 82 TEST_F(LayerClipRecorderTest, Empty)
83 { 83 {
84 GraphicsContext context(&rootDisplayItemList()); 84 GraphicsContext context(&rootDisplayItemList());
85 FloatRect bound = layoutView().viewRect(); 85 FloatRect bound = layoutView().viewRect();
86 EXPECT_EQ((size_t)0, rootDisplayItemList().displayItems().size()); 86 EXPECT_EQ((size_t)0, rootDisplayItemList().displayItems().size());
87 87
88 drawEmptyClip(context, layoutView(), PaintPhaseForeground, bound); 88 drawEmptyClip(context, layoutView(), PaintPhaseForeground, bound);
89 rootDisplayItemList().commitNewDisplayItems(); 89 rootDisplayItemList().commitNewDisplayItems();
90 EXPECT_EQ((size_t)0, rootDisplayItemList().displayItems().size()); 90 EXPECT_EQ((size_t)0, rootDisplayItemList().displayItems().size());
91 } 91 }
92 92
93 } 93 }
94 } 94 }
OLDNEW
« no previous file with comments | « Source/core/paint/LayerClipRecorder.cpp ('k') | Source/core/paint/LayerFixedPositionRecorder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698