Update V8 to version 4.7.42.
[chromium-blink-merge.git] / cc / trees / layer_tree_host_pixeltest_synchronous.cc
blob1eb32ba6440c51873f46c65de2c1b8c1da946c47
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.
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"
14 #if !defined(OS_ANDROID)
16 namespace cc {
17 namespace {
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;
27 void BeginTest() override {
28 LayerTreePixelTest::BeginTest();
29 PostCompositeImmediatelyToMainThread();
33 TEST_F(LayerTreeHostSynchronousPixelTest, OneContentLayer) {
34 gfx::Size bounds(200, 200);
36 FakeContentLayerClient client;
37 SkPaint green_paint;
38 green_paint.setColor(SkColorSetARGB(255, 0, 255, 0));
39 client.add_draw_rect(gfx::Rect(bounds), green_paint);
40 scoped_refptr<PictureLayer> root =
41 PictureLayer::Create(layer_settings(), &client);
42 root->SetBounds(bounds);
43 root->SetIsDrawable(true);
45 RunSingleThreadedPixelTest(
46 PIXEL_TEST_GL, root, base::FilePath(FILE_PATH_LITERAL("green.png")));
49 class LayerTreeHostSynchronousGPUPixelTest : public LayerTreePixelTest {
50 public:
51 void InitializeSettings(LayerTreeSettings* settings) override {
52 LayerTreePixelTest::InitializeSettings(settings);
53 settings->single_thread_proxy_scheduler = false;
54 settings->gpu_rasterization_enabled = true;
55 settings->gpu_rasterization_forced = true;
58 void BeginTest() override {
59 LayerTreePixelTest::BeginTest();
60 PostCompositeImmediatelyToMainThread();
64 TEST_F(LayerTreeHostSynchronousGPUPixelTest, OneContentLayer) {
65 gfx::Size bounds(200, 200);
67 FakeContentLayerClient client;
68 SkPaint green_paint;
69 green_paint.setColor(SkColorSetARGB(255, 0, 255, 0));
70 client.add_draw_rect(gfx::Rect(bounds), green_paint);
71 scoped_refptr<PictureLayer> root =
72 PictureLayer::Create(layer_settings(), &client);
73 root->SetBounds(bounds);
74 root->SetIsDrawable(true);
76 RunSingleThreadedPixelTest(PIXEL_TEST_GL, root,
77 base::FilePath(FILE_PATH_LITERAL("green.png")));
80 } // namespace
81 } // namespace cc
83 #endif // OS_ANDROID