OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "cc/layers/content_layer.h" | 5 #include "cc/layers/content_layer.h" |
6 | 6 |
7 #include "cc/layers/content_layer_client.h" | 7 #include "cc/layers/content_layer_client.h" |
8 #include "cc/resources/bitmap_content_layer_updater.h" | 8 #include "cc/resources/bitmap_content_layer_updater.h" |
9 #include "cc/test/fake_rendering_stats_instrumentation.h" | 9 #include "cc/test/fake_rendering_stats_instrumentation.h" |
10 #include "cc/test/geometry_test_utils.h" | 10 #include "cc/test/geometry_test_utils.h" |
11 #include "skia/ext/platform_canvas.h" | 11 #include "skia/ext/platform_canvas.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 #include "ui/gfx/rect_conversions.h" | 13 #include "ui/gfx/rect_conversions.h" |
14 | 14 |
15 namespace cc { | 15 namespace cc { |
16 namespace { | 16 namespace { |
17 | 17 |
18 class MockContentLayerClient : public ContentLayerClient { | 18 class MockContentLayerClient : public ContentLayerClient { |
19 public: | 19 public: |
20 explicit MockContentLayerClient(const gfx::Rect& opaque_layer_rect) | 20 explicit MockContentLayerClient(const gfx::Rect& opaque_layer_rect) |
21 : opaque_layer_rect_(opaque_layer_rect) {} | 21 : opaque_layer_rect_(opaque_layer_rect) {} |
22 | 22 |
23 virtual void PaintContents(SkCanvas* canvas, | 23 virtual void PaintContents( |
24 const gfx::Rect& clip, | 24 SkCanvas* canvas, |
25 gfx::RectF* opaque) OVERRIDE { | 25 const gfx::Rect& clip, |
| 26 gfx::RectF* opaque, |
| 27 ContentLayerClient::GraphicsContextStatus gc_status) OVERRIDE { |
26 *opaque = gfx::RectF(opaque_layer_rect_); | 28 *opaque = gfx::RectF(opaque_layer_rect_); |
27 } | 29 } |
28 virtual void DidChangeLayerCanUseLCDText() OVERRIDE {} | 30 virtual void DidChangeLayerCanUseLCDText() OVERRIDE {} |
29 virtual bool FillsBoundsCompletely() const OVERRIDE { return false; } | 31 virtual bool FillsBoundsCompletely() const OVERRIDE { return false; } |
30 | 32 |
31 private: | 33 private: |
32 gfx::Rect opaque_layer_rect_; | 34 gfx::Rect opaque_layer_rect_; |
33 }; | 35 }; |
34 | 36 |
35 TEST(ContentLayerTest, ContentLayerPainterWithDeviceScale) { | 37 TEST(ContentLayerTest, ContentLayerPainterWithDeviceScale) { |
(...skipping 16 matching lines...) Expand all Loading... |
52 contents_scale, | 54 contents_scale, |
53 contents_scale, | 55 contents_scale, |
54 &resulting_opaque_rect); | 56 &resulting_opaque_rect); |
55 | 57 |
56 EXPECT_EQ(opaque_rect_in_content_space.ToString(), | 58 EXPECT_EQ(opaque_rect_in_content_space.ToString(), |
57 resulting_opaque_rect.ToString()); | 59 resulting_opaque_rect.ToString()); |
58 } | 60 } |
59 | 61 |
60 } // namespace | 62 } // namespace |
61 } // namespace cc | 63 } // namespace cc |
OLD | NEW |