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

Unified Diff: cc/output/direct_renderer.cc

Issue 1437413002: cc: Remove ScopedPtrVector and cc::remove_if. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/bsp_tree_unittest.cc ('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 a1d3a65a8a11b6b1eb17f7e7edb0d52442f3e90e..9ec397f434f74a957b4ad4be6059399fede02760 100644
--- a/cc/output/direct_renderer.cc
+++ b/cc/output/direct_renderer.cc
@@ -151,7 +151,7 @@ void DirectRenderer::DecideRenderPassAllocationsForFrame(
for (size_t i = 0; i < render_passes_in_draw_order.size(); ++i)
render_passes_in_frame.insert(std::pair<RenderPassId, gfx::Size>(
render_passes_in_draw_order[i]->id,
- RenderPassTextureSize(render_passes_in_draw_order[i])));
+ RenderPassTextureSize(render_passes_in_draw_order[i].get())));
std::vector<RenderPassId> passes_to_delete;
for (auto pass_iter = render_pass_textures_.begin();
@@ -198,7 +198,8 @@ void DirectRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order,
"Renderer4.renderPassCount",
base::saturated_cast<int>(render_passes_in_draw_order->size()));
- const RenderPass* root_render_pass = render_passes_in_draw_order->back();
+ const RenderPass* root_render_pass =
+ render_passes_in_draw_order->back().get();
DCHECK(root_render_pass);
DrawingFrame frame;
@@ -256,7 +257,7 @@ void DirectRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order,
// overlays and dont have any copy requests.
if (frame.root_damage_rect.IsEmpty()) {
bool handle_copy_requests = false;
- for (auto* pass : *render_passes_in_draw_order) {
+ for (const auto& pass : *render_passes_in_draw_order) {
if (!pass->copy_requests.empty()) {
handle_copy_requests = true;
break;
@@ -276,20 +277,17 @@ void DirectRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order,
}
}
- for (size_t i = 0; i < render_passes_in_draw_order->size(); ++i) {
- RenderPass* pass = render_passes_in_draw_order->at(i);
- DrawRenderPass(&frame, pass);
-
- for (ScopedPtrVector<CopyOutputRequest>::iterator it =
- pass->copy_requests.begin();
- it != pass->copy_requests.end();
- ++it) {
- if (it != pass->copy_requests.begin()) {
- // Doing a readback is destructive of our state on Mac, so make sure
- // we restore the state between readbacks. http://crbug.com/99393.
- UseRenderPass(&frame, pass);
- }
- CopyCurrentRenderPassToBitmap(&frame, pass->copy_requests.take(it));
+ for (const auto& pass : *render_passes_in_draw_order) {
+ DrawRenderPass(&frame, pass.get());
+
+ bool first_request = true;
+ for (auto& copy_request : pass->copy_requests) {
+ // Doing a readback is destructive of our state on Mac, so make sure
+ // we restore the state between readbacks. http://crbug.com/99393.
+ if (!first_request)
+ UseRenderPass(&frame, pass.get());
+ CopyCurrentRenderPassToBitmap(&frame, std::move(copy_request));
+ first_request = false;
}
}
FinishDrawingFrame(&frame);
« no previous file with comments | « cc/output/bsp_tree_unittest.cc ('k') | cc/output/gl_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698