| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 2115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2126 gfx::Rect(swap_buffer_rect_.x(), | 2126 gfx::Rect(swap_buffer_rect_.x(), |
| 2127 flipped_y_pos_of_rect_bottom, | 2127 flipped_y_pos_of_rect_bottom, |
| 2128 swap_buffer_rect_.width(), | 2128 swap_buffer_rect_.width(), |
| 2129 swap_buffer_rect_.height()); | 2129 swap_buffer_rect_.height()); |
| 2130 } else { | 2130 } else { |
| 2131 compositor_frame.gl_frame_data->sub_buffer_rect = | 2131 compositor_frame.gl_frame_data->sub_buffer_rect = |
| 2132 gfx::Rect(output_surface_->SurfaceSize()); | 2132 gfx::Rect(output_surface_->SurfaceSize()); |
| 2133 } | 2133 } |
| 2134 output_surface_->SwapBuffers(&compositor_frame); | 2134 output_surface_->SwapBuffers(&compositor_frame); |
| 2135 | 2135 |
| 2136 if (!metadata.overlay_position.IsEmpty()) { |
| 2137 context_support_->SetOverlayPlane( |
| 2138 1, metadata.overlay_texture_id_, metadata.overlay_position); |
| 2139 } |
| 2140 |
| 2136 swap_buffer_rect_ = gfx::Rect(); | 2141 swap_buffer_rect_ = gfx::Rect(); |
| 2137 | 2142 |
| 2138 // We don't have real fences, so we mark read fences as passed | 2143 // We don't have real fences, so we mark read fences as passed |
| 2139 // assuming a double-buffered GPU pipeline. A texture can be | 2144 // assuming a double-buffered GPU pipeline. A texture can be |
| 2140 // written to after one full frame has past since it was last read. | 2145 // written to after one full frame has past since it was last read. |
| 2141 if (last_swap_fence_.get()) | 2146 if (last_swap_fence_.get()) |
| 2142 static_cast<SimpleSwapFence*>(last_swap_fence_.get())->SetHasPassed(); | 2147 static_cast<SimpleSwapFence*>(last_swap_fence_.get())->SetHasPassed(); |
| 2143 last_swap_fence_ = resource_provider_->GetReadLockFence(); | 2148 last_swap_fence_ = resource_provider_->GetReadLockFence(); |
| 2144 resource_provider_->SetReadLockFence(new SimpleSwapFence()); | 2149 resource_provider_->SetReadLockFence(new SimpleSwapFence()); |
| 2145 } | 2150 } |
| (...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3008 is_scissor_enabled_ = false; | 3013 is_scissor_enabled_ = false; |
| 3009 GLC(gl_, gl_->Disable(GL_SCISSOR_TEST)); | 3014 GLC(gl_, gl_->Disable(GL_SCISSOR_TEST)); |
| 3010 scissor_rect_needs_reset_ = true; | 3015 scissor_rect_needs_reset_ = true; |
| 3011 } | 3016 } |
| 3012 | 3017 |
| 3013 bool GLRenderer::IsContextLost() { | 3018 bool GLRenderer::IsContextLost() { |
| 3014 return output_surface_->context_provider()->IsContextLost(); | 3019 return output_surface_->context_provider()->IsContextLost(); |
| 3015 } | 3020 } |
| 3016 | 3021 |
| 3017 } // namespace cc | 3022 } // namespace cc |
| OLD | NEW |