| 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 "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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 TEST_F(LayerClipRecorderTest, Single) | 61 TEST_F(LayerClipRecorderTest, Single) |
| 62 { | 62 { |
| 63 GraphicsContext context(&rootDisplayItemList()); | 63 GraphicsContext context(&rootDisplayItemList()); |
| 64 FloatRect bound = layoutView().viewRect(); | 64 FloatRect bound = layoutView().viewRect(); |
| 65 EXPECT_EQ((size_t)0, rootDisplayItemList().displayItems().size()); | 65 EXPECT_EQ((size_t)0, rootDisplayItemList().displayItems().size()); |
| 66 | 66 |
| 67 drawRectInClip(context, layoutView(), PaintPhaseForeground, bound); | 67 drawRectInClip(context, layoutView(), PaintPhaseForeground, bound); |
| 68 rootDisplayItemList().commitNewDisplayItems(); | 68 rootDisplayItemList().commitNewDisplayItems(); |
| 69 EXPECT_EQ((size_t)3, rootDisplayItemList().displayItems().size()); | 69 EXPECT_EQ((size_t)3, rootDisplayItemList().displayItems().size()); |
| 70 EXPECT_TRUE(rootDisplayItemList().displayItems()[0]->isClip()); | 70 EXPECT_TRUE(DisplayItem::isClipType(rootDisplayItemList().displayItems()[0].
type())); |
| 71 EXPECT_TRUE(rootDisplayItemList().displayItems()[1]->isDrawing()); | 71 EXPECT_TRUE(DisplayItem::isDrawingType(rootDisplayItemList().displayItems()[
1].type())); |
| 72 EXPECT_TRUE(rootDisplayItemList().displayItems()[2]->isEndClip()); | 72 EXPECT_TRUE(DisplayItem::isEndClipType(rootDisplayItemList().displayItems()[
2].type())); |
| 73 } | 73 } |
| 74 | 74 |
| 75 TEST_F(LayerClipRecorderTest, Empty) | 75 TEST_F(LayerClipRecorderTest, Empty) |
| 76 { | 76 { |
| 77 GraphicsContext context(&rootDisplayItemList()); | 77 GraphicsContext context(&rootDisplayItemList()); |
| 78 FloatRect bound = layoutView().viewRect(); | 78 FloatRect bound = layoutView().viewRect(); |
| 79 EXPECT_EQ((size_t)0, rootDisplayItemList().displayItems().size()); | 79 EXPECT_EQ((size_t)0, rootDisplayItemList().displayItems().size()); |
| 80 | 80 |
| 81 drawEmptyClip(context, layoutView(), PaintPhaseForeground, bound); | 81 drawEmptyClip(context, layoutView(), PaintPhaseForeground, bound); |
| 82 rootDisplayItemList().commitNewDisplayItems(); | 82 rootDisplayItemList().commitNewDisplayItems(); |
| 83 EXPECT_EQ((size_t)0, rootDisplayItemList().displayItems().size()); | 83 EXPECT_EQ((size_t)0, rootDisplayItemList().displayItems().size()); |
| 84 } | 84 } |
| 85 | 85 |
| 86 } | 86 } |
| 87 } | 87 } |
| OLD | NEW |