| 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 output_surface_plane.overlay_handled = true; | 235 output_surface_plane.overlay_handled = true; |
| 236 frame.overlay_list.push_back(output_surface_plane); | 236 frame.overlay_list.push_back(output_surface_plane); |
| 237 } | 237 } |
| 238 | 238 |
| 239 // If we have any copy requests, we can't remove any quads for overlays, | 239 // If we have any copy requests, we can't remove any quads for overlays, |
| 240 // otherwise the framebuffer will be missing the overlay contents. | 240 // otherwise the framebuffer will be missing the overlay contents. |
| 241 if (root_render_pass->copy_requests.empty()) { | 241 if (root_render_pass->copy_requests.empty()) { |
| 242 overlay_processor_->ProcessForOverlays( | 242 overlay_processor_->ProcessForOverlays( |
| 243 resource_provider_, render_passes_in_draw_order, &frame.overlay_list, | 243 resource_provider_, render_passes_in_draw_order, &frame.overlay_list, |
| 244 &frame.root_damage_rect); | 244 &frame.root_damage_rect); |
| 245 | |
| 246 // No need to render in case the damage rect is completely composited using | |
| 247 // overlays and dont have any copy requests. | |
| 248 if (frame.root_damage_rect.IsEmpty()) { | |
| 249 bool handle_copy_requests = false; | |
| 250 for (auto* pass : *render_passes_in_draw_order) { | |
| 251 if (!pass->copy_requests.empty()) { | |
| 252 handle_copy_requests = true; | |
| 253 break; | |
| 254 } | |
| 255 } | |
| 256 | |
| 257 if (!handle_copy_requests) { | |
| 258 BindFramebufferToOutputSurface(&frame); | |
| 259 FinishDrawingFrame(&frame); | |
| 260 render_passes_in_draw_order->clear(); | |
| 261 return; | |
| 262 } | |
| 263 } | |
| 264 } | 245 } |
| 265 | 246 |
| 266 for (size_t i = 0; i < render_passes_in_draw_order->size(); ++i) { | 247 for (size_t i = 0; i < render_passes_in_draw_order->size(); ++i) { |
| 267 RenderPass* pass = render_passes_in_draw_order->at(i); | 248 RenderPass* pass = render_passes_in_draw_order->at(i); |
| 268 DrawRenderPass(&frame, pass); | 249 DrawRenderPass(&frame, pass); |
| 269 | 250 |
| 270 for (ScopedPtrVector<CopyOutputRequest>::iterator it = | 251 for (ScopedPtrVector<CopyOutputRequest>::iterator it = |
| 271 pass->copy_requests.begin(); | 252 pass->copy_requests.begin(); |
| 272 it != pass->copy_requests.end(); | 253 it != pass->copy_requests.end(); |
| 273 ++it) { | 254 ++it) { |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 ScopedResource* texture = render_pass_textures_.get(id); | 536 ScopedResource* texture = render_pass_textures_.get(id); |
| 556 return texture && texture->id(); | 537 return texture && texture->id(); |
| 557 } | 538 } |
| 558 | 539 |
| 559 // static | 540 // static |
| 560 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { | 541 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { |
| 561 return render_pass->output_rect.size(); | 542 return render_pass->output_rect.size(); |
| 562 } | 543 } |
| 563 | 544 |
| 564 } // namespace cc | 545 } // namespace cc |
| OLD | NEW |