diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-24 06:45:36 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-24 06:45:36 +0000 |
commit | 0e5f714c8e7d908a44d6474cbf162b9862b895f0 (patch) | |
tree | c22fa14c45d91f2bf2b712b1cca5b3947edaaae0 /cc/test | |
parent | a8e55b1e8c3faef8b9cdd17d444f837773cb8b1c (diff) | |
download | chromium_src-0e5f714c8e7d908a44d6474cbf162b9862b895f0.zip chromium_src-0e5f714c8e7d908a44d6474cbf162b9862b895f0.tar.gz chromium_src-0e5f714c8e7d908a44d6474cbf162b9862b895f0.tar.bz2 |
cc: Add CopyAsBitmapRequest class to hold the readback callback.
Currently when you request an async copy of a layer as a bitmap, we
pass around the raw base::Callback. In order to add functionality to
the copy/readback mechanism, we need to pass along other parameters
such as a size to scale the copy to. Instead of passing along an
ever-growing list of parameters, wrap the base::Callback in a class
called CopyAsBitmapRequest. Then new parameters can be added to this
class.
No change in behaviour here, covered by existing tests.
R=piman
BUG=242571
Review URL: https://chromiumcodereview.appspot.com/15435003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201990 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test')
-rw-r--r-- | cc/test/layer_tree_pixel_test.cc | 5 | ||||
-rw-r--r-- | cc/test/pixel_test.cc | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/cc/test/layer_tree_pixel_test.cc b/cc/test/layer_tree_pixel_test.cc index 6f7ab2f..0489534 100644 --- a/cc/test/layer_tree_pixel_test.cc +++ b/cc/test/layer_tree_pixel_test.cc @@ -5,6 +5,7 @@ #include "cc/test/layer_tree_pixel_test.h" #include "base/path_service.h" +#include "cc/output/copy_output_request.h" #include "cc/test/paths.h" #include "cc/test/pixel_comparator.h" #include "cc/test/pixel_test_utils.h" @@ -65,9 +66,9 @@ void LayerTreePixelTest::ReadbackResult(scoped_ptr<SkBitmap> bitmap) { void LayerTreePixelTest::BeginTest() { Layer* target = readback_target_ ? readback_target_ : layer_tree_host()->root_layer(); - target->RequestCopyAsBitmap( + target->RequestCopyOfOutput(CopyOutputRequest::CreateBitmapRequest( base::Bind(&LayerTreePixelTest::ReadbackResult, - base::Unretained(this))); + base::Unretained(this)))); PostSetNeedsCommitToMainThread(); } diff --git a/cc/test/pixel_test.cc b/cc/test/pixel_test.cc index a191401..47d1796 100644 --- a/cc/test/pixel_test.cc +++ b/cc/test/pixel_test.cc @@ -7,6 +7,7 @@ #include "base/path_service.h" #include "base/run_loop.h" #include "cc/output/compositor_frame_metadata.h" +#include "cc/output/copy_output_request.h" #include "cc/output/gl_renderer.h" #include "cc/output/output_surface.h" #include "cc/output/software_renderer.h" @@ -74,10 +75,10 @@ bool PixelTest::RunPixelTestWithReadbackTarget( const PixelComparator& comparator) { base::RunLoop run_loop; - target->copy_callbacks.push_back( + target->copy_requests.push_back(CopyOutputRequest::CreateBitmapRequest( base::Bind(&PixelTest::ReadbackResult, base::Unretained(this), - run_loop.QuitClosure())); + run_loop.QuitClosure()))); renderer_->DecideRenderPassAllocationsForFrame(*pass_list); renderer_->DrawFrame(pass_list); |