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

Side by Side Diff: cc/output/direct_renderer.cc

Issue 15004009: cc: Fix readback from non-root layers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/cc_tests.gyp ('k') | cc/output/gl_renderer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/output/direct_renderer.h" 5 #include "cc/output/direct_renderer.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 frame.root_damage_rect = 191 frame.root_damage_rect =
192 Capabilities().using_partial_swap && client_->AllowPartialSwap() ? 192 Capabilities().using_partial_swap && client_->AllowPartialSwap() ?
193 root_render_pass->damage_rect : root_render_pass->output_rect; 193 root_render_pass->damage_rect : root_render_pass->output_rect;
194 frame.root_damage_rect.Intersect(gfx::Rect(ViewportSize())); 194 frame.root_damage_rect.Intersect(gfx::Rect(ViewportSize()));
195 195
196 BeginDrawingFrame(&frame); 196 BeginDrawingFrame(&frame);
197 for (size_t i = 0; i < render_passes_in_draw_order->size(); ++i) { 197 for (size_t i = 0; i < render_passes_in_draw_order->size(); ++i) {
198 DrawRenderPass(&frame, render_passes_in_draw_order->at(i)); 198 DrawRenderPass(&frame, render_passes_in_draw_order->at(i));
199 199
200 const RenderPass* pass = frame.current_render_pass; 200 const RenderPass* pass = frame.current_render_pass;
201 for (size_t i = 0; i < pass->copy_callbacks.size(); ++i) 201 for (size_t i = 0; i < pass->copy_callbacks.size(); ++i) {
202 if (i > 0) {
203 // Doing a readback is destructive of our state on Mac, so make sure
204 // we restore the state between readbacks. http://crbug.com/99393.
205 UseRenderPass(&frame, pass);
206 }
202 CopyCurrentRenderPassToBitmap(&frame, pass->copy_callbacks[i]); 207 CopyCurrentRenderPassToBitmap(&frame, pass->copy_callbacks[i]);
208 }
203 } 209 }
204 FinishDrawingFrame(&frame); 210 FinishDrawingFrame(&frame);
205 211
206 render_passes_in_draw_order->clear(); 212 render_passes_in_draw_order->clear();
207 } 213 }
208 214
209 gfx::RectF DirectRenderer::ComputeScissorRectForRenderPass( 215 gfx::RectF DirectRenderer::ComputeScissorRectForRenderPass(
210 const DrawingFrame* frame) { 216 const DrawingFrame* frame) {
211 gfx::RectF render_pass_scissor = frame->current_render_pass->output_rect; 217 gfx::RectF render_pass_scissor = frame->current_render_pass->output_rect;
212 218
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { 351 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) {
346 return render_pass->output_rect.size(); 352 return render_pass->output_rect.size();
347 } 353 }
348 354
349 // static 355 // static
350 GLenum DirectRenderer::RenderPassTextureFormat(const RenderPass* render_pass) { 356 GLenum DirectRenderer::RenderPassTextureFormat(const RenderPass* render_pass) {
351 return GL_RGBA; 357 return GL_RGBA;
352 } 358 }
353 359
354 } // namespace cc 360 } // namespace cc
OLDNEW
« no previous file with comments | « cc/cc_tests.gyp ('k') | cc/output/gl_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698