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 1896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1907 return; | 1907 return; |
1908 | 1908 |
1909 FlushTextureQuadCache(); | 1909 FlushTextureQuadCache(); |
1910 GLC(context_, context_->disable(GL_SCISSOR_TEST)); | 1910 GLC(context_, context_->disable(GL_SCISSOR_TEST)); |
1911 is_scissor_enabled_ = false; | 1911 is_scissor_enabled_ = false; |
1912 } | 1912 } |
1913 | 1913 |
1914 void GLRenderer::CopyCurrentRenderPassToBitmap( | 1914 void GLRenderer::CopyCurrentRenderPassToBitmap( |
1915 DrawingFrame* frame, | 1915 DrawingFrame* frame, |
1916 scoped_ptr<CopyOutputRequest> request) { | 1916 scoped_ptr<CopyOutputRequest> request) { |
1917 GetFramebufferPixelsAsync(frame->current_render_pass->output_rect, | 1917 gfx::Rect copy_rect = frame->current_render_pass->output_rect; |
1918 request.Pass()); | 1918 if (request->has_area()) { |
| 1919 // Intersect with the request's area, positioned with its origin at the |
| 1920 // origin of the full copy_rect. |
| 1921 copy_rect.Intersect(request->area() - copy_rect.OffsetFromOrigin()); |
| 1922 } |
| 1923 GetFramebufferPixelsAsync(copy_rect, request.Pass()); |
1919 } | 1924 } |
1920 | 1925 |
1921 void GLRenderer::ToGLMatrix(float* gl_matrix, const gfx::Transform& transform) { | 1926 void GLRenderer::ToGLMatrix(float* gl_matrix, const gfx::Transform& transform) { |
1922 transform.matrix().asColMajorf(gl_matrix); | 1927 transform.matrix().asColMajorf(gl_matrix); |
1923 } | 1928 } |
1924 | 1929 |
1925 void GLRenderer::SetShaderQuadF(const gfx::QuadF& quad, int quad_location) { | 1930 void GLRenderer::SetShaderQuadF(const gfx::QuadF& quad, int quad_location) { |
1926 if (quad_location == -1) | 1931 if (quad_location == -1) |
1927 return; | 1932 return; |
1928 | 1933 |
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3029 // The Skia GPU backend requires a stencil buffer. See ReinitializeGrCanvas | 3034 // The Skia GPU backend requires a stencil buffer. See ReinitializeGrCanvas |
3030 // implementation. | 3035 // implementation. |
3031 return gr_context_ && context_->getContextAttributes().stencil; | 3036 return gr_context_ && context_->getContextAttributes().stencil; |
3032 } | 3037 } |
3033 | 3038 |
3034 bool GLRenderer::IsContextLost() { | 3039 bool GLRenderer::IsContextLost() { |
3035 return (context_->getGraphicsResetStatusARB() != GL_NO_ERROR); | 3040 return (context_->getGraphicsResetStatusARB() != GL_NO_ERROR); |
3036 } | 3041 } |
3037 | 3042 |
3038 } // namespace cc | 3043 } // namespace cc |
OLD | NEW |