diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-26 16:18:25 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-26 16:18:25 +0000 |
commit | 18a7019dbdee8d72bcdf060fb656295f3b64b60d (patch) | |
tree | 7e4dceed39c7dee39ccb37dd34c33c9e4fe6cdae /cc/output/gl_renderer.cc | |
parent | ebf258d7abe7d118039b56fa3a0c12ed5eb5ceee (diff) | |
download | chromium_src-18a7019dbdee8d72bcdf060fb656295f3b64b60d.zip chromium_src-18a7019dbdee8d72bcdf060fb656295f3b64b60d.tar.gz chromium_src-18a7019dbdee8d72bcdf060fb656295f3b64b60d.tar.bz2 |
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
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196747 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/output/gl_renderer.cc')
-rw-r--r-- | cc/output/gl_renderer.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc index 19b215b..4a0c7ba 100644 --- a/cc/output/gl_renderer.cc +++ b/cc/output/gl_renderer.cc @@ -1776,6 +1776,19 @@ void GLRenderer::EnsureScissorTestDisabled() { is_scissor_enabled_ = false; } +void GLRenderer::CopyCurrentRenderPassToBitmap(DrawingFrame* frame, + SkBitmap* bitmap) { + gfx::Size render_pass_size = frame->current_render_pass->output_rect.size(); + bitmap->setConfig(SkBitmap::kARGB_8888_Config, + render_pass_size.width(), + render_pass_size.height()); + if (bitmap->allocPixels()) { + bitmap->lockPixels(); + GetFramebufferPixels(bitmap->getPixels(), gfx::Rect(render_pass_size)); + bitmap->unlockPixels(); + } +} + void GLRenderer::ToGLMatrix(float* gl_matrix, const gfx::Transform& transform) { transform.matrix().asColMajorf(gl_matrix); } |