| 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 | 215 |
| 216 EnsureBackbuffer(); | 216 EnsureBackbuffer(); |
| 217 | 217 |
| 218 // Only reshape when we know we are going to draw. Otherwise, the reshape | 218 // Only reshape when we know we are going to draw. Otherwise, the reshape |
| 219 // can leave the window at the wrong size if we never draw and the proper | 219 // can leave the window at the wrong size if we never draw and the proper |
| 220 // viewport size is never set. | 220 // viewport size is never set. |
| 221 output_surface_->Reshape(device_viewport_rect.size(), device_scale_factor); | 221 output_surface_->Reshape(device_viewport_rect.size(), device_scale_factor); |
| 222 | 222 |
| 223 BeginDrawingFrame(&frame); | 223 BeginDrawingFrame(&frame); |
| 224 | 224 |
| 225 if (output_surface_->IsDisplayedAsOverlayPlane()) { |
| 226 // Create the overlay candidate for the output surface, and mark it as |
| 227 // always |
| 228 // handled. |
| 229 OverlayCandidate output_surface_plane; |
| 230 output_surface_plane.display_rect = |
| 231 gfx::RectF(root_render_pass->output_rect); |
| 232 output_surface_plane.quad_rect_in_target_space = |
| 233 root_render_pass->output_rect; |
| 234 output_surface_plane.use_output_surface_for_resource = true; |
| 235 output_surface_plane.overlay_handled = true; |
| 236 frame.overlay_list.push_back(output_surface_plane); |
| 237 } |
| 238 |
| 225 // 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, |
| 226 // otherwise the framebuffer will be missing the overlay contents. | 240 // otherwise the framebuffer will be missing the overlay contents. |
| 227 if (root_render_pass->copy_requests.empty()) { | 241 if (root_render_pass->copy_requests.empty()) { |
| 228 overlay_processor_->ProcessForOverlays(render_passes_in_draw_order, | 242 overlay_processor_->ProcessForOverlays(render_passes_in_draw_order, |
| 229 &frame.overlay_list); | 243 &frame.overlay_list); |
| 230 } | 244 } |
| 231 | 245 |
| 232 for (size_t i = 0; i < render_passes_in_draw_order->size(); ++i) { | 246 for (size_t i = 0; i < render_passes_in_draw_order->size(); ++i) { |
| 233 RenderPass* pass = render_passes_in_draw_order->at(i); | 247 RenderPass* pass = render_passes_in_draw_order->at(i); |
| 234 DrawRenderPass(&frame, pass); | 248 DrawRenderPass(&frame, pass); |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 ScopedResource* texture = render_pass_textures_.get(id); | 535 ScopedResource* texture = render_pass_textures_.get(id); |
| 522 return texture && texture->id(); | 536 return texture && texture->id(); |
| 523 } | 537 } |
| 524 | 538 |
| 525 // static | 539 // static |
| 526 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { | 540 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { |
| 527 return render_pass->output_rect.size(); | 541 return render_pass->output_rect.size(); |
| 528 } | 542 } |
| 529 | 543 |
| 530 } // namespace cc | 544 } // namespace cc |
| OLD | NEW |