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 1758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1769 | 1769 |
1770 void GLRenderer::EnsureScissorTestDisabled() { | 1770 void GLRenderer::EnsureScissorTestDisabled() { |
1771 if (!is_scissor_enabled_) | 1771 if (!is_scissor_enabled_) |
1772 return; | 1772 return; |
1773 | 1773 |
1774 FlushTextureQuadCache(); | 1774 FlushTextureQuadCache(); |
1775 GLC(context_, context_->disable(GL_SCISSOR_TEST)); | 1775 GLC(context_, context_->disable(GL_SCISSOR_TEST)); |
1776 is_scissor_enabled_ = false; | 1776 is_scissor_enabled_ = false; |
1777 } | 1777 } |
1778 | 1778 |
| 1779 void GLRenderer::CopyCurrentRenderPassToBitmap(DrawingFrame* frame, |
| 1780 SkBitmap* bitmap) { |
| 1781 gfx::Size render_pass_size = frame->current_render_pass->output_rect.size(); |
| 1782 bitmap->setConfig(SkBitmap::kARGB_8888_Config, |
| 1783 render_pass_size.width(), |
| 1784 render_pass_size.height()); |
| 1785 if (bitmap->allocPixels()) { |
| 1786 bitmap->lockPixels(); |
| 1787 GetFramebufferPixels(bitmap->getPixels(), gfx::Rect(render_pass_size)); |
| 1788 bitmap->unlockPixels(); |
| 1789 } |
| 1790 } |
| 1791 |
1779 void GLRenderer::ToGLMatrix(float* gl_matrix, const gfx::Transform& transform) { | 1792 void GLRenderer::ToGLMatrix(float* gl_matrix, const gfx::Transform& transform) { |
1780 transform.matrix().asColMajorf(gl_matrix); | 1793 transform.matrix().asColMajorf(gl_matrix); |
1781 } | 1794 } |
1782 | 1795 |
1783 void GLRenderer::SetShaderQuadF(const gfx::QuadF& quad, int quad_location) { | 1796 void GLRenderer::SetShaderQuadF(const gfx::QuadF& quad, int quad_location) { |
1784 if (quad_location == -1) | 1797 if (quad_location == -1) |
1785 return; | 1798 return; |
1786 | 1799 |
1787 float point[8]; | 1800 float point[8]; |
1788 point[0] = quad.p1().x(); | 1801 point[0] = quad.p1().x(); |
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2621 resource_provider_->DeleteResource(on_demand_tile_raster_resource_id_); | 2634 resource_provider_->DeleteResource(on_demand_tile_raster_resource_id_); |
2622 | 2635 |
2623 ReleaseRenderPassTextures(); | 2636 ReleaseRenderPassTextures(); |
2624 } | 2637 } |
2625 | 2638 |
2626 bool GLRenderer::IsContextLost() { | 2639 bool GLRenderer::IsContextLost() { |
2627 return (context_->getGraphicsResetStatusARB() != GL_NO_ERROR); | 2640 return (context_->getGraphicsResetStatusARB() != GL_NO_ERROR); |
2628 } | 2641 } |
2629 | 2642 |
2630 } // namespace cc | 2643 } // namespace cc |
OLD | NEW |