| 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 <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 1813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1824 | 1824 |
| 1825 if (capabilities_.using_partial_swap) { | 1825 if (capabilities_.using_partial_swap) { |
| 1826 // If supported, we can save significant bandwidth by only swapping the | 1826 // If supported, we can save significant bandwidth by only swapping the |
| 1827 // damaged/scissored region (clamped to the viewport) | 1827 // damaged/scissored region (clamped to the viewport) |
| 1828 swap_buffer_rect_.Intersect(gfx::Rect(ViewportSize())); | 1828 swap_buffer_rect_.Intersect(gfx::Rect(ViewportSize())); |
| 1829 int flipped_y_pos_of_rect_bottom = | 1829 int flipped_y_pos_of_rect_bottom = |
| 1830 ViewportHeight() - swap_buffer_rect_.y() - swap_buffer_rect_.height(); | 1830 ViewportHeight() - swap_buffer_rect_.y() - swap_buffer_rect_.height(); |
| 1831 output_surface_->PostSubBuffer(gfx::Rect(swap_buffer_rect_.x(), | 1831 output_surface_->PostSubBuffer(gfx::Rect(swap_buffer_rect_.x(), |
| 1832 flipped_y_pos_of_rect_bottom, | 1832 flipped_y_pos_of_rect_bottom, |
| 1833 swap_buffer_rect_.width(), | 1833 swap_buffer_rect_.width(), |
| 1834 swap_buffer_rect_.height())); | 1834 swap_buffer_rect_.height()), |
| 1835 LatencyInfo()); |
| 1835 } else { | 1836 } else { |
| 1836 output_surface_->SwapBuffers(); | 1837 output_surface_->SwapBuffers(LatencyInfo()); |
| 1837 } | 1838 } |
| 1838 | 1839 |
| 1839 swap_buffer_rect_ = gfx::Rect(); | 1840 swap_buffer_rect_ = gfx::Rect(); |
| 1840 | 1841 |
| 1841 // We don't have real fences, so we mark read fences as passed | 1842 // We don't have real fences, so we mark read fences as passed |
| 1842 // assuming a double-buffered GPU pipeline. A texture can be | 1843 // assuming a double-buffered GPU pipeline. A texture can be |
| 1843 // written to after one full frame has past since it was last read. | 1844 // written to after one full frame has past since it was last read. |
| 1844 if (last_swap_fence_) | 1845 if (last_swap_fence_) |
| 1845 static_cast<SimpleSwapFence*>(last_swap_fence_.get())->SetHasPassed(); | 1846 static_cast<SimpleSwapFence*>(last_swap_fence_.get())->SetHasPassed(); |
| 1846 last_swap_fence_ = resource_provider_->GetReadLockFence(); | 1847 last_swap_fence_ = resource_provider_->GetReadLockFence(); |
| (...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2464 resource_provider_->DeleteResource(on_demand_tile_raster_resource_id_); | 2465 resource_provider_->DeleteResource(on_demand_tile_raster_resource_id_); |
| 2465 | 2466 |
| 2466 ReleaseRenderPassTextures(); | 2467 ReleaseRenderPassTextures(); |
| 2467 } | 2468 } |
| 2468 | 2469 |
| 2469 bool GLRenderer::IsContextLost() { | 2470 bool GLRenderer::IsContextLost() { |
| 2470 return (context_->getGraphicsResetStatusARB() != GL_NO_ERROR); | 2471 return (context_->getGraphicsResetStatusARB() != GL_NO_ERROR); |
| 2471 } | 2472 } |
| 2472 | 2473 |
| 2473 } // namespace cc | 2474 } // namespace cc |
| OLD | NEW |