OLD | NEW |
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/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 | 228 |
229 BeginDrawingFrame(&frame); | 229 BeginDrawingFrame(&frame); |
230 for (size_t i = 0; i < render_passes_in_draw_order->size(); ++i) { | 230 for (size_t i = 0; i < render_passes_in_draw_order->size(); ++i) { |
231 RenderPass* pass = render_passes_in_draw_order->at(i); | 231 RenderPass* pass = render_passes_in_draw_order->at(i); |
232 DrawRenderPass(&frame, pass); | 232 DrawRenderPass(&frame, pass); |
233 | 233 |
234 for (ScopedPtrVector<CopyOutputRequest>::iterator it = | 234 for (ScopedPtrVector<CopyOutputRequest>::iterator it = |
235 pass->copy_requests.begin(); | 235 pass->copy_requests.begin(); |
236 it != pass->copy_requests.end(); | 236 it != pass->copy_requests.end(); |
237 ++it) { | 237 ++it) { |
238 if (i > 0) { | 238 if (it != pass->copy_requests.begin()) { |
239 // Doing a readback is destructive of our state on Mac, so make sure | 239 // Doing a readback is destructive of our state on Mac, so make sure |
240 // we restore the state between readbacks. http://crbug.com/99393. | 240 // we restore the state between readbacks. http://crbug.com/99393. |
241 UseRenderPass(&frame, pass); | 241 UseRenderPass(&frame, pass); |
242 } | 242 } |
243 CopyCurrentRenderPassToBitmap(&frame, pass->copy_requests.take(it)); | 243 CopyCurrentRenderPassToBitmap(&frame, pass->copy_requests.take(it)); |
244 } | 244 } |
245 } | 245 } |
246 FinishDrawingFrame(&frame); | 246 FinishDrawingFrame(&frame); |
247 | 247 |
248 render_passes_in_draw_order->clear(); | 248 render_passes_in_draw_order->clear(); |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 ScopedResource* texture = render_pass_textures_.get(id); | 419 ScopedResource* texture = render_pass_textures_.get(id); |
420 return texture && texture->id(); | 420 return texture && texture->id(); |
421 } | 421 } |
422 | 422 |
423 // static | 423 // static |
424 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { | 424 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { |
425 return render_pass->output_rect.size(); | 425 return render_pass->output_rect.size(); |
426 } | 426 } |
427 | 427 |
428 } // namespace cc | 428 } // namespace cc |
OLD | NEW |