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

Side by Side Diff: cc/test/pixel_test.cc

Issue 15004009: cc: Fix readback from non-root layers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « cc/test/pixel_test.h ('k') | cc/trees/layer_tree_host_pixeltest_readback.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "cc/test/pixel_test.h" 5 #include "cc/test/pixel_test.h"
6 6
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "cc/output/compositor_frame_metadata.h" 9 #include "cc/output/compositor_frame_metadata.h"
10 #include "cc/output/gl_renderer.h" 10 #include "cc/output/gl_renderer.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 PixelTest::PixelTest() 55 PixelTest::PixelTest()
56 : device_viewport_size_(gfx::Size(200, 200)), 56 : device_viewport_size_(gfx::Size(200, 200)),
57 fake_client_(new PixelTestRendererClient(device_viewport_size_)) {} 57 fake_client_(new PixelTestRendererClient(device_viewport_size_)) {}
58 58
59 PixelTest::~PixelTest() {} 59 PixelTest::~PixelTest() {}
60 60
61 bool PixelTest::RunPixelTest(RenderPassList* pass_list, 61 bool PixelTest::RunPixelTest(RenderPassList* pass_list,
62 const base::FilePath& ref_file, 62 const base::FilePath& ref_file,
63 const PixelComparator& comparator) { 63 const PixelComparator& comparator) {
64 return RunPixelTestWithReadbackTarget(pass_list,
65 pass_list->back(),
66 ref_file,
67 comparator);
68 }
69
70 bool PixelTest::RunPixelTestWithReadbackTarget(
71 RenderPassList* pass_list,
72 RenderPass* target,
73 const base::FilePath& ref_file,
74 const PixelComparator& comparator) {
64 base::RunLoop run_loop; 75 base::RunLoop run_loop;
65 76
66 pass_list->back()->copy_callbacks.push_back( 77 target->copy_callbacks.push_back(
67 base::Bind(&PixelTest::ReadbackResult, 78 base::Bind(&PixelTest::ReadbackResult,
68 base::Unretained(this), 79 base::Unretained(this),
69 run_loop.QuitClosure())); 80 run_loop.QuitClosure()));
70 81
71 renderer_->DecideRenderPassAllocationsForFrame(*pass_list); 82 renderer_->DecideRenderPassAllocationsForFrame(*pass_list);
72 renderer_->DrawFrame(pass_list); 83 renderer_->DrawFrame(pass_list);
73 84
74 // Wait for the readback to complete. 85 // Wait for the readback to complete.
75 resource_provider_->Finish(); 86 resource_provider_->Finish();
76 run_loop.Run(); 87 run_loop.Run();
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 scoped_ptr<SoftwareOutputDevice> device(new SoftwareOutputDevice()); 141 scoped_ptr<SoftwareOutputDevice> device(new SoftwareOutputDevice());
131 output_surface_.reset(new OutputSurface(device.Pass())); 142 output_surface_.reset(new OutputSurface(device.Pass()));
132 resource_provider_ = ResourceProvider::Create(output_surface_.get(), 0); 143 resource_provider_ = ResourceProvider::Create(output_surface_.get(), 0);
133 renderer_ = SoftwareRenderer::Create( 144 renderer_ = SoftwareRenderer::Create(
134 fake_client_.get(), 145 fake_client_.get(),
135 output_surface_.get(), 146 output_surface_.get(),
136 resource_provider_.get()).PassAs<DirectRenderer>(); 147 resource_provider_.get()).PassAs<DirectRenderer>();
137 } 148 }
138 149
139 } // namespace cc 150 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/pixel_test.h ('k') | cc/trees/layer_tree_host_pixeltest_readback.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698