| OLD | NEW |
| 1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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/gl_renderer.h" | 5 #include "cc/output/gl_renderer.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 2432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2443 if (use_sync_query_) { | 2443 if (use_sync_query_) { |
| 2444 DCHECK(current_sync_query_); | 2444 DCHECK(current_sync_query_); |
| 2445 current_sync_query_->End(); | 2445 current_sync_query_->End(); |
| 2446 pending_sync_queries_.push_back(std::move(current_sync_query_)); | 2446 pending_sync_queries_.push_back(std::move(current_sync_query_)); |
| 2447 } | 2447 } |
| 2448 | 2448 |
| 2449 swap_buffer_rect_.Union(current_frame()->root_damage_rect); | 2449 swap_buffer_rect_.Union(current_frame()->root_damage_rect); |
| 2450 if (overdraw_feedback_) | 2450 if (overdraw_feedback_) |
| 2451 FlushOverdrawFeedback(swap_buffer_rect_); | 2451 FlushOverdrawFeedback(swap_buffer_rect_); |
| 2452 | 2452 |
| 2453 if (use_swap_with_bounds_) |
| 2454 swap_content_bounds_ = current_frame()->root_content_bounds; |
| 2455 |
| 2453 current_framebuffer_lock_ = nullptr; | 2456 current_framebuffer_lock_ = nullptr; |
| 2454 | 2457 |
| 2455 gl_->Disable(GL_BLEND); | 2458 gl_->Disable(GL_BLEND); |
| 2456 blend_shadow_ = false; | 2459 blend_shadow_ = false; |
| 2457 | 2460 |
| 2458 ScheduleCALayers(); | 2461 ScheduleCALayers(); |
| 2459 ScheduleDCLayers(); | 2462 ScheduleDCLayers(); |
| 2460 ScheduleOverlays(); | 2463 ScheduleOverlays(); |
| 2461 } | 2464 } |
| 2462 | 2465 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2607 | 2610 |
| 2608 TRACE_EVENT0("cc", "GLRenderer::SwapBuffers"); | 2611 TRACE_EVENT0("cc", "GLRenderer::SwapBuffers"); |
| 2609 // We're done! Time to swapbuffers! | 2612 // We're done! Time to swapbuffers! |
| 2610 | 2613 |
| 2611 gfx::Size surface_size = surface_size_for_swap_buffers(); | 2614 gfx::Size surface_size = surface_size_for_swap_buffers(); |
| 2612 | 2615 |
| 2613 OutputSurfaceFrame output_frame; | 2616 OutputSurfaceFrame output_frame; |
| 2614 output_frame.latency_info = std::move(latency_info); | 2617 output_frame.latency_info = std::move(latency_info); |
| 2615 output_frame.size = surface_size; | 2618 output_frame.size = surface_size; |
| 2616 if (use_swap_with_bounds_) { | 2619 if (use_swap_with_bounds_) { |
| 2617 output_frame.content_bounds = current_frame()->root_content_bounds; | 2620 output_frame.content_bounds = std::move(swap_content_bounds_); |
| 2618 } else if (use_partial_swap_) { | 2621 } else if (use_partial_swap_) { |
| 2619 // If supported, we can save significant bandwidth by only swapping the | 2622 // If supported, we can save significant bandwidth by only swapping the |
| 2620 // damaged/scissored region (clamped to the viewport). | 2623 // damaged/scissored region (clamped to the viewport). |
| 2621 swap_buffer_rect_.Intersect(gfx::Rect(surface_size)); | 2624 swap_buffer_rect_.Intersect(gfx::Rect(surface_size)); |
| 2622 int flipped_y_pos_of_rect_bottom = surface_size.height() - | 2625 int flipped_y_pos_of_rect_bottom = surface_size.height() - |
| 2623 swap_buffer_rect_.y() - | 2626 swap_buffer_rect_.y() - |
| 2624 swap_buffer_rect_.height(); | 2627 swap_buffer_rect_.height(); |
| 2625 output_frame.sub_buffer_rect = | 2628 output_frame.sub_buffer_rect = |
| 2626 gfx::Rect(swap_buffer_rect_.x(), | 2629 gfx::Rect(swap_buffer_rect_.x(), |
| 2627 FlippedRootFramebuffer() ? flipped_y_pos_of_rect_bottom | 2630 FlippedRootFramebuffer() ? flipped_y_pos_of_rect_bottom |
| (...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3586 return; | 3589 return; |
| 3587 | 3590 |
| 3588 // Report GPU overdraw as a percentage of |max_result|. | 3591 // Report GPU overdraw as a percentage of |max_result|. |
| 3589 TRACE_COUNTER1( | 3592 TRACE_COUNTER1( |
| 3590 TRACE_DISABLED_BY_DEFAULT("cc.debug.overdraw"), "GPU Overdraw", | 3593 TRACE_DISABLED_BY_DEFAULT("cc.debug.overdraw"), "GPU Overdraw", |
| 3591 (std::accumulate(overdraw->begin(), overdraw->end(), 0) * 100) / | 3594 (std::accumulate(overdraw->begin(), overdraw->end(), 0) * 100) / |
| 3592 max_result); | 3595 max_result); |
| 3593 } | 3596 } |
| 3594 | 3597 |
| 3595 } // namespace cc | 3598 } // namespace cc |
| OLD | NEW |