OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "build/build_config.h" |
| 6 #include "cc/layers/content_layer_client.h" |
| 7 #include "cc/layers/picture_image_layer.h" |
| 8 #include "cc/layers/picture_layer.h" |
| 9 #include "cc/layers/solid_color_layer.h" |
| 10 #include "cc/test/fake_content_layer_client.h" |
| 11 #include "cc/test/layer_tree_pixel_test.h" |
| 12 #include "cc/test/pixel_comparator.h" |
| 13 |
| 14 #if !defined(OS_ANDROID) |
| 15 |
| 16 namespace cc { |
| 17 namespace { |
| 18 |
| 19 class LayerTreeHostSynchronousPixelTest : public LayerTreePixelTest { |
| 20 public: |
| 21 void InitializeSettings(LayerTreeSettings* settings) override { |
| 22 LayerTreePixelTest::InitializeSettings(settings); |
| 23 settings->single_thread_proxy_scheduler = false; |
| 24 settings->use_zero_copy = true; |
| 25 } |
| 26 |
| 27 void BeginTest() override { |
| 28 LayerTreePixelTest::BeginTest(); |
| 29 PostCompositeImmediatelyToMainThread(); |
| 30 } |
| 31 }; |
| 32 |
| 33 TEST_F(LayerTreeHostSynchronousPixelTest, OneContentLayer) { |
| 34 gfx::Size bounds(200, 200); |
| 35 |
| 36 FakeContentLayerClient client; |
| 37 SkPaint green_paint; |
| 38 green_paint.setColor(SkColorSetARGB(255, 0, 255, 0)); |
| 39 client.add_draw_rect(gfx::RectF(bounds), green_paint); |
| 40 scoped_refptr<PictureLayer> root = PictureLayer::Create(&client); |
| 41 root->SetBounds(bounds); |
| 42 root->SetIsDrawable(true); |
| 43 |
| 44 RunSingleThreadedPixelTest( |
| 45 PIXEL_TEST_GL, root, base::FilePath(FILE_PATH_LITERAL("green.png"))); |
| 46 } |
| 47 |
| 48 } // namespace |
| 49 } // namespace cc |
| 50 |
| 51 #endif // OS_ANDROID |
OLD | NEW |