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 1878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1889 SetShaderOpacity(1, program->fragment_shader().alpha_location()); | 1889 SetShaderOpacity(1, program->fragment_shader().alpha_location()); |
1890 DrawQuadGeometry( | 1890 DrawQuadGeometry( |
1891 frame, draw_matrix, rect, program->vertex_shader().matrix_location()); | 1891 frame, draw_matrix, rect, program->vertex_shader().matrix_location()); |
1892 } | 1892 } |
1893 | 1893 |
1894 void GLRenderer::Finish() { | 1894 void GLRenderer::Finish() { |
1895 TRACE_EVENT0("cc", "GLRenderer::finish"); | 1895 TRACE_EVENT0("cc", "GLRenderer::finish"); |
1896 context_->finish(); | 1896 context_->finish(); |
1897 } | 1897 } |
1898 | 1898 |
1899 void GLRenderer::SwapBuffers(const LatencyInfo& latency_info) { | 1899 void GLRenderer::SwapBuffers(const ui::LatencyInfo& latency_info) { |
1900 DCHECK(visible_); | 1900 DCHECK(visible_); |
1901 DCHECK(!is_backbuffer_discarded_); | 1901 DCHECK(!is_backbuffer_discarded_); |
1902 | 1902 |
1903 TRACE_EVENT0("cc", "GLRenderer::SwapBuffers"); | 1903 TRACE_EVENT0("cc", "GLRenderer::SwapBuffers"); |
1904 // We're done! Time to swapbuffers! | 1904 // We're done! Time to swapbuffers! |
1905 | 1905 |
1906 if (capabilities_.using_partial_swap && client_->AllowPartialSwap()) { | 1906 if (capabilities_.using_partial_swap && client_->AllowPartialSwap()) { |
1907 // If supported, we can save significant bandwidth by only swapping the | 1907 // If supported, we can save significant bandwidth by only swapping the |
1908 // damaged/scissored region (clamped to the viewport) | 1908 // damaged/scissored region (clamped to the viewport) |
1909 swap_buffer_rect_.Intersect(gfx::Rect(ViewportSize())); | 1909 swap_buffer_rect_.Intersect(gfx::Rect(ViewportSize())); |
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2797 resource_provider_->DeleteResource(on_demand_tile_raster_resource_id_); | 2797 resource_provider_->DeleteResource(on_demand_tile_raster_resource_id_); |
2798 | 2798 |
2799 ReleaseRenderPassTextures(); | 2799 ReleaseRenderPassTextures(); |
2800 } | 2800 } |
2801 | 2801 |
2802 bool GLRenderer::IsContextLost() { | 2802 bool GLRenderer::IsContextLost() { |
2803 return (context_->getGraphicsResetStatusARB() != GL_NO_ERROR); | 2803 return (context_->getGraphicsResetStatusARB() != GL_NO_ERROR); |
2804 } | 2804 } |
2805 | 2805 |
2806 } // namespace cc | 2806 } // namespace cc |
OLD | NEW |