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

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

Issue 1225583004: Revert of Add a FrameView lifecycle method that just updates layout, style and compositing. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/page/PrintContextTest.cpp ('k') | Source/core/paint/TextPainterTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "platform/graphics/paint/DisplayItemList.h" 6 #include "platform/graphics/paint/DisplayItemList.h"
7 7
8 #include "core/layout/LayoutTestHelper.h" 8 #include "core/layout/LayoutTestHelper.h"
9 #include "core/layout/LayoutText.h" 9 #include "core/layout/LayoutText.h"
10 #include "core/layout/LayoutView.h" 10 #include "core/layout/LayoutView.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 GraphicsContext context(&rootDisplayItemList()); 98 GraphicsContext context(&rootDisplayItemList());
99 DeprecatedPaintLayerPaintingInfo paintingInfo(&rootLayer, LayoutRect(0, 0, 8 00, 600), PaintBehaviorNormal, LayoutSize()); 99 DeprecatedPaintLayerPaintingInfo paintingInfo(&rootLayer, LayoutRect(0, 0, 8 00, 600), PaintBehaviorNormal, LayoutSize());
100 DeprecatedPaintLayerPainter(rootLayer).paintLayerContents(&context, painting Info, PaintLayerPaintingCompositingAllPhases); 100 DeprecatedPaintLayerPainter(rootLayer).paintLayerContents(&context, painting Info, PaintLayerPaintingCompositingAllPhases);
101 rootDisplayItemList().commitNewDisplayItems(); 101 rootDisplayItemList().commitNewDisplayItems();
102 102
103 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 2, 103 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 2,
104 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), 104 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground),
105 TestDisplayItem(textInlineBox, DisplayItem::paintPhaseToDrawingType(Pain tPhaseForeground))); 105 TestDisplayItem(textInlineBox, DisplayItem::paintPhaseToDrawingType(Pain tPhaseForeground)));
106 106
107 div.focus(); 107 div.focus();
108 document().view()->updateAllLifecyclePhases(); 108 document().view()->updateLayoutAndStyleForPainting();
109 EXPECT_TRUE(rootDisplayItemList().clientCacheIsValid(layoutView.displayItemC lient())); 109 EXPECT_TRUE(rootDisplayItemList().clientCacheIsValid(layoutView.displayItemC lient()));
110 EXPECT_FALSE(rootDisplayItemList().clientCacheIsValid(divLayoutObject.displa yItemClient())); 110 EXPECT_FALSE(rootDisplayItemList().clientCacheIsValid(divLayoutObject.displa yItemClient()));
111 EXPECT_TRUE(rootDisplayItemList().clientCacheIsValid(textInlineBox.displayIt emClient())); 111 EXPECT_TRUE(rootDisplayItemList().clientCacheIsValid(textInlineBox.displayIt emClient()));
112 DeprecatedPaintLayerPainter(rootLayer).paintLayerContents(&context, painting Info, PaintLayerPaintingCompositingAllPhases); 112 DeprecatedPaintLayerPainter(rootLayer).paintLayerContents(&context, painting Info, PaintLayerPaintingCompositingAllPhases);
113 rootDisplayItemList().commitNewDisplayItems(); 113 rootDisplayItemList().commitNewDisplayItems();
114 114
115 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 3, 115 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 3,
116 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), 116 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground),
117 TestDisplayItem(textInlineBox, DisplayItem::paintPhaseToDrawingType(Pain tPhaseForeground)), 117 TestDisplayItem(textInlineBox, DisplayItem::paintPhaseToDrawingType(Pain tPhaseForeground)),
118 TestDisplayItem(divLayoutObject, DisplayItem::Caret)); // New! 118 TestDisplayItem(divLayoutObject, DisplayItem::Caret)); // New!
(...skipping 13 matching lines...) Expand all
132 GraphicsContext context(&rootDisplayItemList()); 132 GraphicsContext context(&rootDisplayItemList());
133 DeprecatedPaintLayerPaintingInfo paintingInfo(&rootLayer, LayoutRect(0, 0, 8 00, 600), PaintBehaviorNormal, LayoutSize()); 133 DeprecatedPaintLayerPaintingInfo paintingInfo(&rootLayer, LayoutRect(0, 0, 8 00, 600), PaintBehaviorNormal, LayoutSize());
134 DeprecatedPaintLayerPainter(rootLayer).paintLayerContents(&context, painting Info, PaintLayerPaintingCompositingAllPhases); 134 DeprecatedPaintLayerPainter(rootLayer).paintLayerContents(&context, painting Info, PaintLayerPaintingCompositingAllPhases);
135 rootDisplayItemList().commitNewDisplayItems(); 135 rootDisplayItemList().commitNewDisplayItems();
136 136
137 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 2, 137 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 2,
138 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), 138 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground),
139 TestDisplayItem(firstTextBox, DisplayItem::paintPhaseToDrawingType(Paint PhaseForeground))); 139 TestDisplayItem(firstTextBox, DisplayItem::paintPhaseToDrawingType(Paint PhaseForeground)));
140 140
141 div.setAttribute(HTMLNames::styleAttr, "width: 10px; height: 200px"); 141 div.setAttribute(HTMLNames::styleAttr, "width: 10px; height: 200px");
142 document().view()->updateAllLifecyclePhases(); 142 document().view()->updateLayoutAndStyleForPainting();
143 EXPECT_TRUE(rootDisplayItemList().clientCacheIsValid(layoutView.displayItemC lient())); 143 EXPECT_TRUE(rootDisplayItemList().clientCacheIsValid(layoutView.displayItemC lient()));
144 EXPECT_FALSE(rootDisplayItemList().clientCacheIsValid(divBlock.displayItemCl ient())); 144 EXPECT_FALSE(rootDisplayItemList().clientCacheIsValid(divBlock.displayItemCl ient()));
145 EXPECT_FALSE(rootDisplayItemList().clientCacheIsValid(firstTextBoxDisplayIte mClient)); 145 EXPECT_FALSE(rootDisplayItemList().clientCacheIsValid(firstTextBoxDisplayIte mClient));
146 DeprecatedPaintLayerPainter(rootLayer).paintLayerContents(&context, painting Info, PaintLayerPaintingCompositingAllPhases); 146 DeprecatedPaintLayerPainter(rootLayer).paintLayerContents(&context, painting Info, PaintLayerPaintingCompositingAllPhases);
147 rootDisplayItemList().commitNewDisplayItems(); 147 rootDisplayItemList().commitNewDisplayItems();
148 148
149 LayoutText& newText = *toLayoutText(divBlock.firstChild()); 149 LayoutText& newText = *toLayoutText(divBlock.firstChild());
150 InlineTextBox& newFirstTextBox = *newText.firstTextBox(); 150 InlineTextBox& newFirstTextBox = *newText.firstTextBox();
151 InlineTextBox& secondTextBox = *newText.firstTextBox()->nextTextBox(); 151 InlineTextBox& secondTextBox = *newText.firstTextBox()->nextTextBox();
152 152
153 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 3, 153 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 3,
154 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), 154 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground),
155 TestDisplayItem(newFirstTextBox, DisplayItem::paintPhaseToDrawingType(Pa intPhaseForeground)), 155 TestDisplayItem(newFirstTextBox, DisplayItem::paintPhaseToDrawingType(Pa intPhaseForeground)),
156 TestDisplayItem(secondTextBox, DisplayItem::paintPhaseToDrawingType(Pain tPhaseForeground))); 156 TestDisplayItem(secondTextBox, DisplayItem::paintPhaseToDrawingType(Pain tPhaseForeground)));
157 } 157 }
158 158
159 } // namespace blink 159 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/page/PrintContextTest.cpp ('k') | Source/core/paint/TextPainterTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698