Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(279)

Side by Side Diff: cc/trees/layer_tree_host_pixeltest_synchronous.cc

Issue 1036693002: cc: Fix crash while running blink layout tests with GPU rasterization (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: +test Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698