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 2083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2094 } | 2094 } |
2095 | 2095 |
2096 void GLRenderer::Finish() { | 2096 void GLRenderer::Finish() { |
2097 TRACE_EVENT0("cc", "GLRenderer::Finish"); | 2097 TRACE_EVENT0("cc", "GLRenderer::Finish"); |
2098 GLC(gl_, gl_->Finish()); | 2098 GLC(gl_, gl_->Finish()); |
2099 } | 2099 } |
2100 | 2100 |
2101 void GLRenderer::SwapBuffers(const CompositorFrameMetadata& metadata) { | 2101 void GLRenderer::SwapBuffers(const CompositorFrameMetadata& metadata) { |
2102 DCHECK(!is_backbuffer_discarded_); | 2102 DCHECK(!is_backbuffer_discarded_); |
2103 | 2103 |
2104 TRACE_EVENT0("cc", "GLRenderer::SwapBuffers"); | 2104 TRACE_EVENT0("cc,cc-benchmark", "GLRenderer::SwapBuffers"); |
2105 // We're done! Time to swapbuffers! | 2105 // We're done! Time to swapbuffers! |
2106 | 2106 |
2107 gfx::Size surface_size = output_surface_->SurfaceSize(); | 2107 gfx::Size surface_size = output_surface_->SurfaceSize(); |
2108 | 2108 |
2109 CompositorFrame compositor_frame; | 2109 CompositorFrame compositor_frame; |
2110 compositor_frame.metadata = metadata; | 2110 compositor_frame.metadata = metadata; |
2111 compositor_frame.gl_frame_data = make_scoped_ptr(new GLFrameData); | 2111 compositor_frame.gl_frame_data = make_scoped_ptr(new GLFrameData); |
2112 compositor_frame.gl_frame_data->size = surface_size; | 2112 compositor_frame.gl_frame_data->size = surface_size; |
2113 if (capabilities_.using_partial_swap) { | 2113 if (capabilities_.using_partial_swap) { |
2114 // If supported, we can save significant bandwidth by only swapping the | 2114 // If supported, we can save significant bandwidth by only swapping the |
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3003 is_scissor_enabled_ = false; | 3003 is_scissor_enabled_ = false; |
3004 GLC(gl_, gl_->Disable(GL_SCISSOR_TEST)); | 3004 GLC(gl_, gl_->Disable(GL_SCISSOR_TEST)); |
3005 scissor_rect_needs_reset_ = true; | 3005 scissor_rect_needs_reset_ = true; |
3006 } | 3006 } |
3007 | 3007 |
3008 bool GLRenderer::IsContextLost() { | 3008 bool GLRenderer::IsContextLost() { |
3009 return output_surface_->context_provider()->IsContextLost(); | 3009 return output_surface_->context_provider()->IsContextLost(); |
3010 } | 3010 } |
3011 | 3011 |
3012 } // namespace cc | 3012 } // namespace cc |
OLD | NEW |