| 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 1852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1863 | 1863 |
| 1864 if (capabilities_.using_partial_swap && client_->AllowPartialSwap()) { | 1864 if (capabilities_.using_partial_swap && client_->AllowPartialSwap()) { |
| 1865 // If supported, we can save significant bandwidth by only swapping the | 1865 // If supported, we can save significant bandwidth by only swapping the |
| 1866 // damaged/scissored region (clamped to the viewport) | 1866 // damaged/scissored region (clamped to the viewport) |
| 1867 swap_buffer_rect_.Intersect(gfx::Rect(ViewportSize())); | 1867 swap_buffer_rect_.Intersect(gfx::Rect(ViewportSize())); |
| 1868 int flipped_y_pos_of_rect_bottom = | 1868 int flipped_y_pos_of_rect_bottom = |
| 1869 ViewportHeight() - swap_buffer_rect_.y() - swap_buffer_rect_.height(); | 1869 ViewportHeight() - swap_buffer_rect_.y() - swap_buffer_rect_.height(); |
| 1870 output_surface_->PostSubBuffer(gfx::Rect(swap_buffer_rect_.x(), | 1870 output_surface_->PostSubBuffer(gfx::Rect(swap_buffer_rect_.x(), |
| 1871 flipped_y_pos_of_rect_bottom, | 1871 flipped_y_pos_of_rect_bottom, |
| 1872 swap_buffer_rect_.width(), | 1872 swap_buffer_rect_.width(), |
| 1873 swap_buffer_rect_.height())); | 1873 swap_buffer_rect_.height()), |
| 1874 LatencyInfo()); |
| 1874 } else { | 1875 } else { |
| 1875 output_surface_->SwapBuffers(); | 1876 output_surface_->SwapBuffers(LatencyInfo()); |
| 1876 } | 1877 } |
| 1877 | 1878 |
| 1878 swap_buffer_rect_ = gfx::Rect(); | 1879 swap_buffer_rect_ = gfx::Rect(); |
| 1879 | 1880 |
| 1880 // We don't have real fences, so we mark read fences as passed | 1881 // We don't have real fences, so we mark read fences as passed |
| 1881 // assuming a double-buffered GPU pipeline. A texture can be | 1882 // assuming a double-buffered GPU pipeline. A texture can be |
| 1882 // written to after one full frame has past since it was last read. | 1883 // written to after one full frame has past since it was last read. |
| 1883 if (last_swap_fence_) | 1884 if (last_swap_fence_) |
| 1884 static_cast<SimpleSwapFence*>(last_swap_fence_.get())->SetHasPassed(); | 1885 static_cast<SimpleSwapFence*>(last_swap_fence_.get())->SetHasPassed(); |
| 1885 last_swap_fence_ = resource_provider_->GetReadLockFence(); | 1886 last_swap_fence_ = resource_provider_->GetReadLockFence(); |
| (...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2583 resource_provider_->DeleteResource(on_demand_tile_raster_resource_id_); | 2584 resource_provider_->DeleteResource(on_demand_tile_raster_resource_id_); |
| 2584 | 2585 |
| 2585 ReleaseRenderPassTextures(); | 2586 ReleaseRenderPassTextures(); |
| 2586 } | 2587 } |
| 2587 | 2588 |
| 2588 bool GLRenderer::IsContextLost() { | 2589 bool GLRenderer::IsContextLost() { |
| 2589 return (context_->getGraphicsResetStatusARB() != GL_NO_ERROR); | 2590 return (context_->getGraphicsResetStatusARB() != GL_NO_ERROR); |
| 2590 } | 2591 } |
| 2591 | 2592 |
| 2592 } // namespace cc | 2593 } // namespace cc |
| OLD | NEW |