summaryrefslogtreecommitdiffstats
path: root/cc/test/layer_tree_pixel_test.cc
diff options
context:
space:
mode:
authorkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-26 04:33:11 +0000
committerkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-26 04:33:11 +0000
commit38f118b3f788a3326c1bae943841364eddacfd69 (patch)
tree5af6d07f28c3053a66f86ec7080880a942e0dad8 /cc/test/layer_tree_pixel_test.cc
parent3be28fc804be417f9aa4554df81f2f0a97f3608c (diff)
downloadchromium_src-38f118b3f788a3326c1bae943841364eddacfd69.zip
chromium_src-38f118b3f788a3326c1bae943841364eddacfd69.tar.gz
chromium_src-38f118b3f788a3326c1bae943841364eddacfd69.tar.bz2
Revert 196592 "cc: Async readback."
suspected to break cc_unittests GLRendererPixelTest.AxisAligned on multiple bots > cc: Async readback. > > Provide a path to get a readback of a layer's subtree via an > asynchronous mechanism. > > This path is used for all the cc pixel tests, to show that it > works. Also by some unit tests: > > LayerTreeHostTestAsyncReadback.GLRenderer_RunSingleThread > LayerTreeHostTestAsyncReadback.GLRenderer_RunMultiThread > LayerTreeHostTestAsyncReadback.SoftwareRenderer_RunSingleThread > LayerTreeHostTestAsyncReadback.SoftwareRenderer_RunMultiThread > LayerTreeHostTestAsyncReadbackLayerDestroyed.RunSingleThread > LayerTreeHostTestAsyncReadbackLayerDestroyed.RunMultiThread > > BUG=179896 > > Review URL: https://chromiumcodereview.appspot.com/14060015 TBR=danakj@chromium.org Review URL: https://codereview.chromium.org/14510002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196605 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/layer_tree_pixel_test.cc')
-rw-r--r--cc/test/layer_tree_pixel_test.cc24
1 files changed, 17 insertions, 7 deletions
diff --git a/cc/test/layer_tree_pixel_test.cc b/cc/test/layer_tree_pixel_test.cc
index 1dfc551..34a0f8d 100644
--- a/cc/test/layer_tree_pixel_test.cc
+++ b/cc/test/layer_tree_pixel_test.cc
@@ -47,25 +47,35 @@ LayerTreePixelTest::OffscreenContextProviderForCompositorThread() {
return provider;
}
-void LayerTreePixelTest::ReadbackResult(scoped_ptr<SkBitmap> bitmap) {
- ASSERT_TRUE(bitmap);
+void LayerTreePixelTest::SwapBuffersOnThread(LayerTreeHostImpl* host_impl,
+ bool result) {
+ EXPECT_TRUE(result);
+
+ gfx::Rect device_viewport_rect(
+ host_impl->active_tree()->device_viewport_size());
+
+ SkBitmap bitmap;
+ bitmap.setConfig(SkBitmap::kARGB_8888_Config,
+ device_viewport_rect.width(),
+ device_viewport_rect.height());
+ bitmap.allocPixels();
+ unsigned char* pixels = static_cast<unsigned char*>(bitmap.getPixels());
+ host_impl->Readback(pixels, device_viewport_rect);
base::FilePath test_data_dir;
EXPECT_TRUE(PathService::Get(cc::DIR_TEST_DATA, &test_data_dir));
// To rebaseline:
- // EXPECT_TRUE(WritePNGFile(*bitmap, test_data_dir.Append(ref_file_), true));
+ // EXPECT_TRUE(WritePNGFile(bitmap, test_data_dir.Append(ref_file_), true));
- EXPECT_TRUE(MatchesPNGFile(*bitmap,
+ EXPECT_TRUE(MatchesPNGFile(bitmap,
test_data_dir.Append(ref_file_),
*pixel_comparator_));
+
EndTest();
}
void LayerTreePixelTest::BeginTest() {
- layer_tree_host()->root_layer()->RequestCopyAsBitmap(
- base::Bind(&LayerTreePixelTest::ReadbackResult,
- base::Unretained(this)));
PostSetNeedsCommitToMainThread();
}