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

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

Issue 2661523003: cc: Merge LayerTree into the LayerTreeHost. (Closed)
Patch Set: auto Created 3 years, 10 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/test/fake_layer_tree_host.cc ('k') | cc/test/layer_tree_test.h » ('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/layer_tree_pixel_test.h" 5 #include "cc/test/layer_tree_pixel_test.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 95
96 void LayerTreePixelTest::ReadbackResult( 96 void LayerTreePixelTest::ReadbackResult(
97 std::unique_ptr<CopyOutputResult> result) { 97 std::unique_ptr<CopyOutputResult> result) {
98 ASSERT_TRUE(result->HasBitmap()); 98 ASSERT_TRUE(result->HasBitmap());
99 result_bitmap_ = result->TakeBitmap(); 99 result_bitmap_ = result->TakeBitmap();
100 EndTest(); 100 EndTest();
101 } 101 }
102 102
103 void LayerTreePixelTest::BeginTest() { 103 void LayerTreePixelTest::BeginTest() {
104 Layer* target = 104 Layer* target =
105 readback_target_ ? readback_target_ : layer_tree()->root_layer(); 105 readback_target_ ? readback_target_ : layer_tree_host()->root_layer();
106 target->RequestCopyOfOutput(CreateCopyOutputRequest()); 106 target->RequestCopyOfOutput(CreateCopyOutputRequest());
107 PostSetNeedsCommitToMainThread(); 107 PostSetNeedsCommitToMainThread();
108 } 108 }
109 109
110 void LayerTreePixelTest::AfterTest() { 110 void LayerTreePixelTest::AfterTest() {
111 base::FilePath test_data_dir; 111 base::FilePath test_data_dir;
112 EXPECT_TRUE(PathService::Get(CCPaths::DIR_TEST_DATA, &test_data_dir)); 112 EXPECT_TRUE(PathService::Get(CCPaths::DIR_TEST_DATA, &test_data_dir));
113 base::FilePath ref_file_path = test_data_dir.Append(ref_file_); 113 base::FilePath ref_file_path = test_data_dir.Append(ref_file_);
114 114
115 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); 115 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess();
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 content_root_ = content_root; 208 content_root_ = content_root;
209 readback_target_ = target; 209 readback_target_ = target;
210 ref_file_ = file_name; 210 ref_file_ = file_name;
211 RunTest(CompositorMode::THREADED); 211 RunTest(CompositorMode::THREADED);
212 } 212 }
213 213
214 void LayerTreePixelTest::SetupTree() { 214 void LayerTreePixelTest::SetupTree() {
215 scoped_refptr<Layer> root = Layer::Create(); 215 scoped_refptr<Layer> root = Layer::Create();
216 root->SetBounds(content_root_->bounds()); 216 root->SetBounds(content_root_->bounds());
217 root->AddChild(content_root_); 217 root->AddChild(content_root_);
218 layer_tree()->SetRootLayer(root); 218 layer_tree_host()->SetRootLayer(root);
219 LayerTreeTest::SetupTree(); 219 LayerTreeTest::SetupTree();
220 } 220 }
221 221
222 std::unique_ptr<SkBitmap> LayerTreePixelTest::CopyTextureMailboxToBitmap( 222 std::unique_ptr<SkBitmap> LayerTreePixelTest::CopyTextureMailboxToBitmap(
223 const gfx::Size& size, 223 const gfx::Size& size,
224 const TextureMailbox& texture_mailbox) { 224 const TextureMailbox& texture_mailbox) {
225 DCHECK(texture_mailbox.IsTexture()); 225 DCHECK(texture_mailbox.IsTexture());
226 if (!texture_mailbox.IsTexture()) 226 if (!texture_mailbox.IsTexture())
227 return nullptr; 227 return nullptr;
228 228
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 } 286 }
287 287
288 void LayerTreePixelTest::Finish() { 288 void LayerTreePixelTest::Finish() {
289 std::unique_ptr<gpu::GLInProcessContext> context = 289 std::unique_ptr<gpu::GLInProcessContext> context =
290 CreateTestInProcessContext(); 290 CreateTestInProcessContext();
291 GLES2Interface* gl = context->GetImplementation(); 291 GLES2Interface* gl = context->GetImplementation();
292 gl->Finish(); 292 gl->Finish();
293 } 293 }
294 294
295 } // namespace cc 295 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/fake_layer_tree_host.cc ('k') | cc/test/layer_tree_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698