summaryrefslogtreecommitdiffstats
path: root/cc/output/direct_renderer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cc/output/direct_renderer.cc')
-rw-r--r--cc/output/direct_renderer.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/cc/output/direct_renderer.cc b/cc/output/direct_renderer.cc
index ae8ff9b..7d0083f 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();