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

Unified Diff: cc/test/layer_tree_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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/test/layer_tree_pixel_test.h ('k') | cc/test/pixel_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/layer_tree_pixel_test.cc
diff --git a/cc/test/layer_tree_pixel_test.cc b/cc/test/layer_tree_pixel_test.cc
index 1dfc551c5358361979dfc4a13fadf5b34fa4ca0e..1c9855fd56f83c289a03659d704cfd637f4d5ede 100644
--- a/cc/test/layer_tree_pixel_test.cc
+++ b/cc/test/layer_tree_pixel_test.cc
@@ -63,7 +63,9 @@ void LayerTreePixelTest::ReadbackResult(scoped_ptr<SkBitmap> bitmap) {
}
void LayerTreePixelTest::BeginTest() {
- layer_tree_host()->root_layer()->RequestCopyAsBitmap(
+ Layer* target = readback_target_ ? readback_target_
+ : layer_tree_host()->root_layer();
+ target->RequestCopyAsBitmap(
base::Bind(&LayerTreePixelTest::ReadbackResult,
base::Unretained(this)));
PostSetNeedsCommitToMainThread();
@@ -114,6 +116,17 @@ void LayerTreePixelTest::RunPixelTest(
scoped_refptr<Layer> content_root,
base::FilePath file_name) {
content_root_ = content_root;
+ readback_target_ = NULL;
+ ref_file_ = file_name;
+ RunTest(true);
+}
+
+void LayerTreePixelTest::RunPixelTestWithReadbackTarget(
+ scoped_refptr<Layer> content_root,
+ Layer* target,
+ base::FilePath file_name) {
+ content_root_ = content_root;
+ readback_target_ = target;
ref_file_ = file_name;
RunTest(true);
}
« no previous file with comments | « cc/test/layer_tree_pixel_test.h ('k') | cc/test/pixel_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698