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 "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/fake_content_layer_client.h" | 10 #include "cc/test/fake_content_layer_client.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 void BeginTest() override { | 27 void BeginTest() override { |
28 LayerTreePixelTest::BeginTest(); | 28 LayerTreePixelTest::BeginTest(); |
29 PostCompositeImmediatelyToMainThread(); | 29 PostCompositeImmediatelyToMainThread(); |
30 } | 30 } |
31 }; | 31 }; |
32 | 32 |
33 TEST_F(LayerTreeHostSynchronousPixelTest, OneContentLayer) { | 33 TEST_F(LayerTreeHostSynchronousPixelTest, OneContentLayer) { |
34 gfx::Size bounds(200, 200); | 34 gfx::Size bounds(200, 200); |
35 | 35 |
36 FakeContentLayerClient client; | 36 FakeContentLayerClient client; |
| 37 client.set_bounds(bounds); |
37 SkPaint green_paint; | 38 SkPaint green_paint; |
38 green_paint.setColor(SkColorSetARGB(255, 0, 255, 0)); | 39 green_paint.setColor(SkColorSetARGB(255, 0, 255, 0)); |
39 client.add_draw_rect(gfx::Rect(bounds), green_paint); | 40 client.add_draw_rect(gfx::Rect(bounds), green_paint); |
40 scoped_refptr<PictureLayer> root = | 41 scoped_refptr<PictureLayer> root = |
41 PictureLayer::Create(layer_settings(), &client); | 42 PictureLayer::Create(layer_settings(), &client); |
42 root->SetBounds(bounds); | 43 root->SetBounds(bounds); |
43 root->SetIsDrawable(true); | 44 root->SetIsDrawable(true); |
44 | 45 |
45 RunSingleThreadedPixelTest( | 46 RunSingleThreadedPixelTest( |
46 PIXEL_TEST_GL, root, base::FilePath(FILE_PATH_LITERAL("green.png"))); | 47 PIXEL_TEST_GL, root, base::FilePath(FILE_PATH_LITERAL("green.png"))); |
(...skipping 11 matching lines...) Expand all Loading... |
58 void BeginTest() override { | 59 void BeginTest() override { |
59 LayerTreePixelTest::BeginTest(); | 60 LayerTreePixelTest::BeginTest(); |
60 PostCompositeImmediatelyToMainThread(); | 61 PostCompositeImmediatelyToMainThread(); |
61 } | 62 } |
62 }; | 63 }; |
63 | 64 |
64 TEST_F(LayerTreeHostSynchronousGPUPixelTest, OneContentLayer) { | 65 TEST_F(LayerTreeHostSynchronousGPUPixelTest, OneContentLayer) { |
65 gfx::Size bounds(200, 200); | 66 gfx::Size bounds(200, 200); |
66 | 67 |
67 FakeContentLayerClient client; | 68 FakeContentLayerClient client; |
| 69 client.set_bounds(bounds); |
68 SkPaint green_paint; | 70 SkPaint green_paint; |
69 green_paint.setColor(SkColorSetARGB(255, 0, 255, 0)); | 71 green_paint.setColor(SkColorSetARGB(255, 0, 255, 0)); |
70 client.add_draw_rect(gfx::Rect(bounds), green_paint); | 72 client.add_draw_rect(gfx::Rect(bounds), green_paint); |
71 scoped_refptr<PictureLayer> root = | 73 scoped_refptr<PictureLayer> root = |
72 PictureLayer::Create(layer_settings(), &client); | 74 PictureLayer::Create(layer_settings(), &client); |
73 root->SetBounds(bounds); | 75 root->SetBounds(bounds); |
| 76 client.set_bounds(bounds); |
74 root->SetIsDrawable(true); | 77 root->SetIsDrawable(true); |
75 | 78 |
76 RunSingleThreadedPixelTest(PIXEL_TEST_GL, root, | 79 RunSingleThreadedPixelTest(PIXEL_TEST_GL, root, |
77 base::FilePath(FILE_PATH_LITERAL("green.png"))); | 80 base::FilePath(FILE_PATH_LITERAL("green.png"))); |
78 } | 81 } |
79 | 82 |
80 } // namespace | 83 } // namespace |
81 } // namespace cc | 84 } // namespace cc |
82 | 85 |
83 #endif // OS_ANDROID | 86 #endif // OS_ANDROID |
OLD | NEW |