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 1750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1761 | 1761 |
1762 void GLRenderer::EnsureScissorTestDisabled() { | 1762 void GLRenderer::EnsureScissorTestDisabled() { |
1763 if (!is_scissor_enabled_) | 1763 if (!is_scissor_enabled_) |
1764 return; | 1764 return; |
1765 | 1765 |
1766 FlushTextureQuadCache(); | 1766 FlushTextureQuadCache(); |
1767 GLC(context_, context_->disable(GL_SCISSOR_TEST)); | 1767 GLC(context_, context_->disable(GL_SCISSOR_TEST)); |
1768 is_scissor_enabled_ = false; | 1768 is_scissor_enabled_ = false; |
1769 } | 1769 } |
1770 | 1770 |
| 1771 void GLRenderer::CopyCurrentRenderPassToBitmap(DrawingFrame* frame, |
| 1772 SkBitmap* bitmap) { |
| 1773 gfx::Size render_pass_size = frame->current_render_pass->output_rect.size(); |
| 1774 bitmap->setConfig(SkBitmap::kARGB_8888_Config, |
| 1775 render_pass_size.width(), |
| 1776 render_pass_size.height()); |
| 1777 if (bitmap->allocPixels()) { |
| 1778 bitmap->lockPixels(); |
| 1779 GetFramebufferPixels(bitmap->getPixels(), gfx::Rect(render_pass_size)); |
| 1780 bitmap->unlockPixels(); |
| 1781 } |
| 1782 } |
| 1783 |
1771 void GLRenderer::ToGLMatrix(float* gl_matrix, const gfx::Transform& transform) { | 1784 void GLRenderer::ToGLMatrix(float* gl_matrix, const gfx::Transform& transform) { |
1772 transform.matrix().asColMajorf(gl_matrix); | 1785 transform.matrix().asColMajorf(gl_matrix); |
1773 } | 1786 } |
1774 | 1787 |
1775 void GLRenderer::SetShaderQuadF(const gfx::QuadF& quad, int quad_location) { | 1788 void GLRenderer::SetShaderQuadF(const gfx::QuadF& quad, int quad_location) { |
1776 if (quad_location == -1) | 1789 if (quad_location == -1) |
1777 return; | 1790 return; |
1778 | 1791 |
1779 float point[8]; | 1792 float point[8]; |
1780 point[0] = quad.p1().x(); | 1793 point[0] = quad.p1().x(); |
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2613 resource_provider_->DeleteResource(on_demand_tile_raster_resource_id_); | 2626 resource_provider_->DeleteResource(on_demand_tile_raster_resource_id_); |
2614 | 2627 |
2615 ReleaseRenderPassTextures(); | 2628 ReleaseRenderPassTextures(); |
2616 } | 2629 } |
2617 | 2630 |
2618 bool GLRenderer::IsContextLost() { | 2631 bool GLRenderer::IsContextLost() { |
2619 return (context_->getGraphicsResetStatusARB() != GL_NO_ERROR); | 2632 return (context_->getGraphicsResetStatusARB() != GL_NO_ERROR); |
2620 } | 2633 } |
2621 | 2634 |
2622 } // namespace cc | 2635 } // namespace cc |
OLD | NEW |