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

Unified Diff: cc/output/direct_renderer.cc

Issue 14060015: cc: Async readback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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
« no previous file with comments | « cc/output/direct_renderer.h ('k') | cc/output/gl_renderer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/direct_renderer.cc
diff --git a/cc/output/direct_renderer.cc b/cc/output/direct_renderer.cc
index ae8ff9b336335b4fc05bf32acf993de2fe891976..7d0083f73a6fa805bbe871424bcedb56ca45aef5 100644
--- a/cc/output/direct_renderer.cc
+++ b/cc/output/direct_renderer.cc
@@ -8,6 +8,7 @@
#include <vector>
#include "base/debug/trace_event.h"
+#include "base/hash_tables.h"
#include "base/metrics/histogram.h"
#include "cc/base/math_util.h"
#include "cc/quads/draw_quad.h"
@@ -192,9 +193,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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698