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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 15435003: cc: Add CopyAsBitmapRequest class to hold the readback callback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nolint 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_unittest.cc
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index f5c140edfa1b53183cbd2079e66a7cbf60dfbc3e..ac53b795cba6b37c8857165e0ca0d20c2967fc63 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -15,6 +15,7 @@
#include "cc/layers/layer_impl.h"
#include "cc/layers/picture_layer.h"
#include "cc/layers/scrollbar_layer.h"
+#include "cc/output/copy_output_request.h"
#include "cc/output/output_surface.h"
#include "cc/resources/prioritized_resource.h"
#include "cc/resources/prioritized_resource_manager.h"
@@ -2625,9 +2626,9 @@ class LayerTreeHostTestAsyncReadback : public LayerTreeHostTest {
int frame = layer_tree_host()->commit_number();
switch (frame) {
case 1:
- child->RequestCopyAsBitmap(base::Bind(
- &LayerTreeHostTestAsyncReadback::BitmapCallback,
- base::Unretained(this)));
+ child->RequestCopyOfOutput(CopyOutputRequest::CreateBitmapRequest(
+ base::Bind(&LayerTreeHostTestAsyncReadback::BitmapCallback,
+ base::Unretained(this))));
EXPECT_EQ(0u, callbacks_.size());
break;
case 2:
@@ -2638,15 +2639,15 @@ class LayerTreeHostTestAsyncReadback : public LayerTreeHostTest {
EXPECT_EQ(1u, callbacks_.size());
EXPECT_EQ(gfx::Size(10, 10).ToString(), callbacks_[0].ToString());
- child->RequestCopyAsBitmap(base::Bind(
- &LayerTreeHostTestAsyncReadback::BitmapCallback,
- base::Unretained(this)));
- root->RequestCopyAsBitmap(base::Bind(
- &LayerTreeHostTestAsyncReadback::BitmapCallback,
- base::Unretained(this)));
- child->RequestCopyAsBitmap(base::Bind(
- &LayerTreeHostTestAsyncReadback::BitmapCallback,
- base::Unretained(this)));
+ child->RequestCopyOfOutput(CopyOutputRequest::CreateBitmapRequest(
+ base::Bind(&LayerTreeHostTestAsyncReadback::BitmapCallback,
+ base::Unretained(this))));
+ root->RequestCopyOfOutput(CopyOutputRequest::CreateBitmapRequest(
+ base::Bind(&LayerTreeHostTestAsyncReadback::BitmapCallback,
+ base::Unretained(this))));
+ child->RequestCopyOfOutput(CopyOutputRequest::CreateBitmapRequest(
+ base::Bind(&LayerTreeHostTestAsyncReadback::BitmapCallback,
+ base::Unretained(this))));
EXPECT_EQ(1u, callbacks_.size());
break;
case 3:
@@ -2751,12 +2752,14 @@ class LayerTreeHostTestAsyncReadbackLayerDestroyed : public LayerTreeHostTest {
int frame = layer_tree_host()->commit_number();
switch (frame) {
case 1:
- main_destroyed_->RequestCopyAsBitmap(base::Bind(
- &LayerTreeHostTestAsyncReadbackLayerDestroyed::BitmapCallback,
- base::Unretained(this)));
- impl_destroyed_->RequestCopyAsBitmap(base::Bind(
- &LayerTreeHostTestAsyncReadbackLayerDestroyed::BitmapCallback,
- base::Unretained(this)));
+ main_destroyed_->RequestCopyOfOutput(
+ CopyOutputRequest::CreateBitmapRequest(base::Bind(
+ &LayerTreeHostTestAsyncReadbackLayerDestroyed::BitmapCallback,
+ base::Unretained(this))));
+ impl_destroyed_->RequestCopyOfOutput(
+ CopyOutputRequest::CreateBitmapRequest(base::Bind(
+ &LayerTreeHostTestAsyncReadbackLayerDestroyed::BitmapCallback,
+ base::Unretained(this))));
EXPECT_EQ(0, callback_count_);
// Destroy the main thread layer right away.
« 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