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 <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1649 bool GLRenderer::SwapBuffers() { | 1649 bool GLRenderer::SwapBuffers() { |
1650 DCHECK(visible_); | 1650 DCHECK(visible_); |
1651 DCHECK(!is_backbuffer_discarded_); | 1651 DCHECK(!is_backbuffer_discarded_); |
1652 | 1652 |
1653 TRACE_EVENT0("cc", "GLRenderer::SwapBuffers"); | 1653 TRACE_EVENT0("cc", "GLRenderer::SwapBuffers"); |
1654 // We're done! Time to swapbuffers! | 1654 // We're done! Time to swapbuffers! |
1655 | 1655 |
1656 if (capabilities_.using_partial_swap) { | 1656 if (capabilities_.using_partial_swap) { |
1657 // If supported, we can save significant bandwidth by only swapping the | 1657 // If supported, we can save significant bandwidth by only swapping the |
1658 // damaged/scissored region (clamped to the viewport) | 1658 // damaged/scissored region (clamped to the viewport) |
1659 swap_buffer_rect_.Intersect(gfx::Rect(gfx::Point(), ViewportSize())); | 1659 swap_buffer_rect_.Intersect(gfx::Rect(ViewportSize())); |
1660 int flipped_y_pos_of_rect_bottom = | 1660 int flipped_y_pos_of_rect_bottom = |
1661 ViewportHeight() - swap_buffer_rect_.y() - swap_buffer_rect_.height(); | 1661 ViewportHeight() - swap_buffer_rect_.y() - swap_buffer_rect_.height(); |
1662 output_surface_->PostSubBuffer(gfx::Rect(swap_buffer_rect_.x(), | 1662 output_surface_->PostSubBuffer(gfx::Rect(swap_buffer_rect_.x(), |
1663 flipped_y_pos_of_rect_bottom, | 1663 flipped_y_pos_of_rect_bottom, |
1664 swap_buffer_rect_.width(), | 1664 swap_buffer_rect_.width(), |
1665 swap_buffer_rect_.height())); | 1665 swap_buffer_rect_.height())); |
1666 } else { | 1666 } else { |
1667 output_surface_->SwapBuffers(); | 1667 output_surface_->SwapBuffers(); |
1668 } | 1668 } |
1669 | 1669 |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2229 GLC(context_, context_->deleteFramebuffer(offscreen_framebuffer_id_)); | 2229 GLC(context_, context_->deleteFramebuffer(offscreen_framebuffer_id_)); |
2230 | 2230 |
2231 ReleaseRenderPassTextures(); | 2231 ReleaseRenderPassTextures(); |
2232 } | 2232 } |
2233 | 2233 |
2234 bool GLRenderer::IsContextLost() { | 2234 bool GLRenderer::IsContextLost() { |
2235 return (context_->getGraphicsResetStatusARB() != GL_NO_ERROR); | 2235 return (context_->getGraphicsResetStatusARB() != GL_NO_ERROR); |
2236 } | 2236 } |
2237 | 2237 |
2238 } // namespace cc | 2238 } // namespace cc |
OLD | NEW |