OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 #include "cc/layers/content_layer_client.h" | 6 #include "cc/layers/content_layer_client.h" |
7 #include "cc/layers/picture_image_layer.h" | 7 #include "cc/layers/picture_image_layer.h" |
8 #include "cc/layers/picture_layer.h" | 8 #include "cc/layers/picture_layer.h" |
9 #include "cc/layers/solid_color_layer.h" | 9 #include "cc/layers/solid_color_layer.h" |
10 #include "cc/test/layer_tree_pixel_test.h" | 10 #include "cc/test/layer_tree_pixel_test.h" |
11 #include "cc/test/pixel_comparator.h" | 11 #include "cc/test/pixel_comparator.h" |
12 | 12 |
13 #if !defined(OS_ANDROID) | 13 #if !defined(OS_ANDROID) |
14 | 14 |
15 namespace cc { | 15 namespace cc { |
16 namespace { | 16 namespace { |
17 | 17 |
18 class LayerTreeHostMasksPixelTest : public LayerTreePixelTest {}; | 18 class LayerTreeHostMasksPixelTest : public LayerTreePixelTest {}; |
19 | 19 |
20 class MaskContentLayerClient : public ContentLayerClient { | 20 class MaskContentLayerClient : public ContentLayerClient { |
21 public: | 21 public: |
22 explicit MaskContentLayerClient(const gfx::Size& bounds) : bounds_(bounds) {} | 22 explicit MaskContentLayerClient(const gfx::Size& bounds) : bounds_(bounds) {} |
23 virtual ~MaskContentLayerClient() {} | 23 ~MaskContentLayerClient() override {} |
24 | 24 |
25 virtual void DidChangeLayerCanUseLCDText() override {} | 25 void DidChangeLayerCanUseLCDText() override {} |
26 | 26 |
27 virtual bool FillsBoundsCompletely() const override { return false; } | 27 bool FillsBoundsCompletely() const override { return false; } |
28 | 28 |
29 virtual void PaintContents( | 29 void PaintContents( |
30 SkCanvas* canvas, | 30 SkCanvas* canvas, |
31 const gfx::Rect& rect, | 31 const gfx::Rect& rect, |
32 ContentLayerClient::GraphicsContextStatus gc_status) override { | 32 ContentLayerClient::GraphicsContextStatus gc_status) override { |
33 SkPaint paint; | 33 SkPaint paint; |
34 paint.setStyle(SkPaint::kStroke_Style); | 34 paint.setStyle(SkPaint::kStroke_Style); |
35 paint.setStrokeWidth(SkIntToScalar(2)); | 35 paint.setStrokeWidth(SkIntToScalar(2)); |
36 paint.setColor(SK_ColorWHITE); | 36 paint.setColor(SK_ColorWHITE); |
37 | 37 |
38 canvas->clear(SK_ColorTRANSPARENT); | 38 canvas->clear(SK_ColorTRANSPARENT); |
39 gfx::Rect inset_rect(bounds_); | 39 gfx::Rect inset_rect(bounds_); |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 RunPixelTest(GL_WITH_BITMAP, | 275 RunPixelTest(GL_WITH_BITMAP, |
276 background, | 276 background, |
277 base::FilePath(FILE_PATH_LITERAL( | 277 base::FilePath(FILE_PATH_LITERAL( |
278 "mask_of_replica_of_clipped_layer.png"))); | 278 "mask_of_replica_of_clipped_layer.png"))); |
279 } | 279 } |
280 | 280 |
281 } // namespace | 281 } // namespace |
282 } // namespace cc | 282 } // namespace cc |
283 | 283 |
284 #endif // OS_ANDROID | 284 #endif // OS_ANDROID |
OLD | NEW |