| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } |
| OLD | NEW |