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

Unified Diff: cc/output/direct_renderer.cc

Issue 14060015: cc: Async readback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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
Index: cc/output/direct_renderer.cc
diff --git a/cc/output/direct_renderer.cc b/cc/output/direct_renderer.cc
index ae8ff9b336335b4fc05bf32acf993de2fe891976..bb8449bcb8cf6bcf8088ed60fc8bb5c6ad6dac8c 100644
--- a/cc/output/direct_renderer.cc
+++ b/cc/output/direct_renderer.cc
@@ -192,9 +192,19 @@ void DirectRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order) {
root_render_pass->damage_rect : root_render_pass->output_rect;
frame.root_damage_rect.Intersect(gfx::Rect(ViewportSize()));
+ std::vector<base::Closure> copy_callbacks;
+
BeginDrawingFrame(&frame);
- for (size_t i = 0; i < render_passes_in_draw_order->size(); ++i)
+ for (size_t i = 0; i < render_passes_in_draw_order->size(); ++i) {
DrawRenderPass(&frame, render_passes_in_draw_order->at(i));
+
+ const RenderPass* pass = frame.current_render_pass;
+ for (size_t i = 0; i < pass->copy_callbacks.size(); ++i) {
+ scoped_ptr<SkBitmap> bitmap(new SkBitmap);
+ CopyCurrentRenderPassToBitmap(&frame, bitmap.get());
+ pass->copy_callbacks[i].Run(bitmap.Pass());
+ }
+ }
FinishDrawingFrame(&frame);
render_passes_in_draw_order->clear();
« no previous file with comments | « cc/output/direct_renderer.h ('k') | cc/output/gl_renderer.h » ('j') | cc/output/gl_renderer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698