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/ClipRecorder.h" | 6 #include "core/paint/ClipRecorder.h" |
7 | 7 |
8 #include "core/rendering/RenderView.h" | 8 #include "core/rendering/RenderView.h" |
9 #include "core/rendering/RenderingTestHelper.h" | 9 #include "core/rendering/RenderingTestHelper.h" |
10 #include "core/rendering/compositing/RenderLayerCompositor.h" | 10 #include "core/rendering/compositing/RenderLayerCompositor.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 ASSERT_TRUE(m_renderView); | 32 ASSERT_TRUE(m_renderView); |
33 } | 33 } |
34 | 34 |
35 RenderView* m_renderView; | 35 RenderView* m_renderView; |
36 }; | 36 }; |
37 | 37 |
38 void drawClip(GraphicsContext* context, RenderView* renderer, PaintPhase phase,
const FloatRect& bound) | 38 void drawClip(GraphicsContext* context, RenderView* renderer, PaintPhase phase,
const FloatRect& bound) |
39 { | 39 { |
40 IntRect rect(1, 1, 9, 9); | 40 IntRect rect(1, 1, 9, 9); |
41 ClipRect clipRect(rect); | 41 ClipRect clipRect(rect); |
42 ClipRecorder clipRecorder(renderer->compositor()->rootRenderLayer(), context
, DisplayItem::ClipLayerForeground, clipRect); | 42 ClipRecorder clipRecorder(renderer->compositor()->rootRenderLayer()->rendere
r(), context, DisplayItem::ClipLayerForeground, clipRect); |
43 } | 43 } |
44 | 44 |
45 TEST_F(ClipRecorderTest, ClipRecorderTest_Single) | 45 TEST_F(ClipRecorderTest, ClipRecorderTest_Single) |
46 { | 46 { |
47 GraphicsContext* context = new GraphicsContext(nullptr); | 47 GraphicsContext* context = new GraphicsContext(nullptr); |
48 FloatRect bound = renderView()->viewRect(); | 48 FloatRect bound = renderView()->viewRect(); |
49 EXPECT_EQ((size_t)0, renderView()->viewDisplayList().paintList().size()); | 49 EXPECT_EQ((size_t)0, renderView()->viewDisplayList().paintList().size()); |
50 | 50 |
51 drawClip(context, renderView(), PaintPhaseForeground, bound); | 51 drawClip(context, renderView(), PaintPhaseForeground, bound); |
52 EXPECT_EQ((size_t)2, renderView()->viewDisplayList().paintList().size()); | 52 EXPECT_EQ((size_t)2, renderView()->viewDisplayList().paintList().size()); |
53 } | 53 } |
54 | 54 |
55 } | 55 } |
56 } | 56 } |
OLD | NEW |