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

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

Issue 1419283002: cc: Split Proxy and TaskRunnerProvider for the LayerTreeHost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 5 years, 1 month 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_unittest.cc ('k') | cc/trees/layer_tree_host_unittest.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 "build/build_config.h" 5 #include "build/build_config.h"
6 #include "cc/layers/solid_color_layer.h" 6 #include "cc/layers/solid_color_layer.h"
7 #include "cc/layers/texture_layer.h" 7 #include "cc/layers/texture_layer.h"
8 #include "cc/output/copy_output_request.h" 8 #include "cc/output/copy_output_request.h"
9 #include "cc/output/copy_output_result.h" 9 #include "cc/output/copy_output_result.h"
10 #include "cc/test/fake_picture_layer.h" 10 #include "cc/test/fake_picture_layer.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 void DidCommitAndDrawFrame() override { 98 void DidCommitAndDrawFrame() override {
99 if (insert_copy_request_after_frame_count_ == 99 if (insert_copy_request_after_frame_count_ ==
100 layer_tree_host()->source_frame_number()) { 100 layer_tree_host()->source_frame_number()) {
101 Layer* const target = 101 Layer* const target =
102 readback_target_ ? readback_target_ : layer_tree_host()->root_layer(); 102 readback_target_ ? readback_target_ : layer_tree_host()->root_layer();
103 target->RequestCopyOfOutput(CreateCopyOutputRequest().Pass()); 103 target->RequestCopyOfOutput(CreateCopyOutputRequest().Pass());
104 } 104 }
105 } 105 }
106 106
107 void ReadbackResultAsBitmap(scoped_ptr<CopyOutputResult> result) { 107 void ReadbackResultAsBitmap(scoped_ptr<CopyOutputResult> result) {
108 EXPECT_TRUE(proxy()->IsMainThread()); 108 EXPECT_TRUE(task_runner_provider()->IsMainThread());
109 EXPECT_TRUE(result->HasBitmap()); 109 EXPECT_TRUE(result->HasBitmap());
110 result_bitmap_ = result->TakeBitmap().Pass(); 110 result_bitmap_ = result->TakeBitmap().Pass();
111 EndTest(); 111 EndTest();
112 } 112 }
113 113
114 void ReadbackResultAsTexture(scoped_ptr<CopyOutputResult> result) { 114 void ReadbackResultAsTexture(scoped_ptr<CopyOutputResult> result) {
115 EXPECT_TRUE(proxy()->IsMainThread()); 115 EXPECT_TRUE(task_runner_provider()->IsMainThread());
116 EXPECT_TRUE(result->HasTexture()); 116 EXPECT_TRUE(result->HasTexture());
117 117
118 TextureMailbox texture_mailbox; 118 TextureMailbox texture_mailbox;
119 scoped_ptr<SingleReleaseCallback> release_callback; 119 scoped_ptr<SingleReleaseCallback> release_callback;
120 result->TakeTexture(&texture_mailbox, &release_callback); 120 result->TakeTexture(&texture_mailbox, &release_callback);
121 EXPECT_TRUE(texture_mailbox.IsValid()); 121 EXPECT_TRUE(texture_mailbox.IsValid());
122 EXPECT_TRUE(texture_mailbox.IsTexture()); 122 EXPECT_TRUE(texture_mailbox.IsTexture());
123 123
124 scoped_ptr<SkBitmap> bitmap = 124 scoped_ptr<SkBitmap> bitmap =
125 CopyTextureMailboxToBitmap(result->size(), texture_mailbox); 125 CopyTextureMailboxToBitmap(result->size(), texture_mailbox);
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 READBACK_DEFAULT), 547 READBACK_DEFAULT),
548 ReadbackTestConfig(LayerTreeHostReadbackPixelTest::PIXEL_TEST_GL, 548 ReadbackTestConfig(LayerTreeHostReadbackPixelTest::PIXEL_TEST_GL,
549 READBACK_DEFAULT), 549 READBACK_DEFAULT),
550 ReadbackTestConfig(LayerTreeHostReadbackPixelTest::PIXEL_TEST_GL, 550 ReadbackTestConfig(LayerTreeHostReadbackPixelTest::PIXEL_TEST_GL,
551 READBACK_BITMAP))); 551 READBACK_BITMAP)));
552 552
553 } // namespace 553 } // namespace
554 } // namespace cc 554 } // namespace cc
555 555
556 #endif // OS_ANDROID 556 #endif // OS_ANDROID
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698