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 26 matching lines...) Expand all Loading... | |
37 green_paint.setColor(SkColorSetARGB(255, 0, 255, 0)); | 37 green_paint.setColor(SkColorSetARGB(255, 0, 255, 0)); |
38 client.add_draw_rect(gfx::RectF(bounds), green_paint); | 38 client.add_draw_rect(gfx::RectF(bounds), green_paint); |
39 scoped_refptr<PictureLayer> root = PictureLayer::Create(&client); | 39 scoped_refptr<PictureLayer> root = PictureLayer::Create(&client); |
40 root->SetBounds(bounds); | 40 root->SetBounds(bounds); |
41 root->SetIsDrawable(true); | 41 root->SetIsDrawable(true); |
42 | 42 |
43 RunSingleThreadedPixelTest( | 43 RunSingleThreadedPixelTest( |
44 PIXEL_TEST_GL, root, base::FilePath(FILE_PATH_LITERAL("green.png"))); | 44 PIXEL_TEST_GL, root, base::FilePath(FILE_PATH_LITERAL("green.png"))); |
45 } | 45 } |
46 | 46 |
47 class LayerTreeHostSynchronousGPUPixelTest : public LayerTreePixelTest { | |
enne (OOO)
2015/03/25 17:10:22
Ooh, perfect. Thanks!
| |
48 public: | |
49 void InitializeSettings(LayerTreeSettings* settings) override { | |
50 LayerTreePixelTest::InitializeSettings(settings); | |
51 settings->single_thread_proxy_scheduler = false; | |
52 settings->gpu_rasterization_enabled = true; | |
53 settings->gpu_rasterization_forced = true; | |
54 } | |
55 | |
56 void BeginTest() override { | |
57 LayerTreePixelTest::BeginTest(); | |
58 PostCompositeImmediatelyToMainThread(); | |
59 } | |
60 }; | |
61 | |
62 TEST_F(LayerTreeHostSynchronousGPUPixelTest, OneContentLayer) { | |
63 gfx::Size bounds(200, 200); | |
64 | |
65 FakeContentLayerClient client; | |
66 SkPaint green_paint; | |
67 green_paint.setColor(SkColorSetARGB(255, 0, 255, 0)); | |
68 client.add_draw_rect(gfx::RectF(bounds), green_paint); | |
69 scoped_refptr<PictureLayer> root = PictureLayer::Create(&client); | |
70 root->SetBounds(bounds); | |
71 root->SetIsDrawable(true); | |
72 | |
73 RunSingleThreadedPixelTest(PIXEL_TEST_GL, root, | |
74 base::FilePath(FILE_PATH_LITERAL("green.png"))); | |
75 } | |
76 | |
47 } // namespace | 77 } // namespace |
48 } // namespace cc | 78 } // namespace cc |
49 | 79 |
50 #endif // OS_ANDROID | 80 #endif // OS_ANDROID |
OLD | NEW |