| OLD | NEW |
| 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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 EXPECT_TRUE(backgroundChunk.properties.scroll->isRoot()); | 167 EXPECT_TRUE(backgroundChunk.properties.scroll->isRoot()); |
| 168 | 168 |
| 169 const EffectPaintPropertyNode* effectNode = | 169 const EffectPaintPropertyNode* effectNode = |
| 170 div.objectPaintProperties()->effect(); | 170 div.objectPaintProperties()->effect(); |
| 171 EXPECT_EQ(0.5f, effectNode->opacity()); | 171 EXPECT_EQ(0.5f, effectNode->opacity()); |
| 172 const PaintChunk& chunk = rootPaintController().paintChunks()[1]; | 172 const PaintChunk& chunk = rootPaintController().paintChunks()[1]; |
| 173 EXPECT_EQ(*div.layer(), chunk.id->client); | 173 EXPECT_EQ(*div.layer(), chunk.id->client); |
| 174 EXPECT_EQ(effectNode, chunk.properties.effect.get()); | 174 EXPECT_EQ(effectNode, chunk.properties.effect.get()); |
| 175 | 175 |
| 176 EXPECT_FALSE(div.layer()->isJustCreated()); | 176 EXPECT_FALSE(div.layer()->isJustCreated()); |
| 177 // Client used by only paint chunks and non-cachaeable display items but not b
y any | 177 // Client used by only paint chunks and non-cachaeable display items but not |
| 178 // cacheable display items won't be marked as validly cached. | 178 // by any cacheable display items won't be marked as validly cached. |
| 179 EXPECT_FALSE(rootPaintController().clientCacheIsValid(*div.layer())); | 179 EXPECT_FALSE(rootPaintController().clientCacheIsValid(*div.layer())); |
| 180 EXPECT_FALSE(rootPaintController().clientCacheIsValid(div)); | 180 EXPECT_FALSE(rootPaintController().clientCacheIsValid(div)); |
| 181 EXPECT_TRUE(rootPaintController().clientCacheIsValid(subDiv)); | 181 EXPECT_TRUE(rootPaintController().clientCacheIsValid(subDiv)); |
| 182 } | 182 } |
| 183 | 183 |
| 184 TEST_F(PaintControllerPaintTestForSlimmingPaintV2, CompositingFold) { | 184 TEST_F(PaintControllerPaintTestForSlimmingPaintV2, CompositingFold) { |
| 185 setBodyInnerHTML( | 185 setBodyInnerHTML( |
| 186 "<div id='div' style='width: 200px; height: 200px; opacity: 0.5'>" | 186 "<div id='div' style='width: 200px; height: 200px; opacity: 0.5'>" |
| 187 " <div style='width: 100px; height: 100px; background-color: " | 187 " <div style='width: 100px; height: 100px; background-color: " |
| 188 "blue'></div>" | 188 "blue'></div>" |
| 189 "</div>"); | 189 "</div>"); |
| 190 PaintLayer& htmlLayer = | 190 PaintLayer& htmlLayer = |
| 191 *toLayoutBoxModelObject(document().documentElement()->layoutObject()) | 191 *toLayoutBoxModelObject(document().documentElement()->layoutObject()) |
| 192 ->layer(); | 192 ->layer(); |
| 193 LayoutBlock& div = *toLayoutBlock(getLayoutObjectByElementId("div")); | 193 LayoutBlock& div = *toLayoutBlock(getLayoutObjectByElementId("div")); |
| 194 LayoutObject& subDiv = *div.firstChild(); | 194 LayoutObject& subDiv = *div.firstChild(); |
| 195 | 195 |
| 196 EXPECT_DISPLAY_LIST( | 196 EXPECT_DISPLAY_LIST( |
| 197 rootPaintController().getDisplayItemList(), 8, | 197 rootPaintController().getDisplayItemList(), 8, |
| 198 TestDisplayItem(layoutView(), | 198 TestDisplayItem(layoutView(), |
| 199 DisplayItem::kClipFrameToVisibleContentRect), | 199 DisplayItem::kClipFrameToVisibleContentRect), |
| 200 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence), | 200 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence), |
| 201 TestDisplayItem(layoutView(), documentBackgroundType), | 201 TestDisplayItem(layoutView(), documentBackgroundType), |
| 202 TestDisplayItem(htmlLayer, DisplayItem::kSubsequence), | 202 TestDisplayItem(htmlLayer, DisplayItem::kSubsequence), |
| 203 // The begin and end compositing display items have been folded into this
one. | 203 // The begin and end compositing display items have been folded into this |
| 204 // one. |
| 204 TestDisplayItem(subDiv, backgroundType), | 205 TestDisplayItem(subDiv, backgroundType), |
| 205 TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence), | 206 TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence), |
| 206 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence), | 207 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence), |
| 207 TestDisplayItem(layoutView(), | 208 TestDisplayItem(layoutView(), |
| 208 DisplayItem::clipTypeToEndClipType( | 209 DisplayItem::clipTypeToEndClipType( |
| 209 DisplayItem::kClipFrameToVisibleContentRect))); | 210 DisplayItem::kClipFrameToVisibleContentRect))); |
| 210 } | 211 } |
| 211 | 212 |
| 212 } // namespace blink | 213 } // namespace blink |
| OLD | NEW |