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 1745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1756 | 1756 |
1757 void GLRenderer::EnsureScissorTestDisabled() { | 1757 void GLRenderer::EnsureScissorTestDisabled() { |
1758 if (!is_scissor_enabled_) | 1758 if (!is_scissor_enabled_) |
1759 return; | 1759 return; |
1760 | 1760 |
1761 FlushTextureQuadCache(); | 1761 FlushTextureQuadCache(); |
1762 GLC(context_, context_->disable(GL_SCISSOR_TEST)); | 1762 GLC(context_, context_->disable(GL_SCISSOR_TEST)); |
1763 is_scissor_enabled_ = false; | 1763 is_scissor_enabled_ = false; |
1764 } | 1764 } |
1765 | 1765 |
1766 void GLRenderer::CopyCurrentRenderPassToBitmap(DrawingFrame* frame, | |
1767 SkBitmap* bitmap) { | |
1768 gfx::Size render_pass_size = frame->current_render_pass->output_rect.size(); | |
1769 bitmap->setConfig(SkBitmap::kARGB_8888_Config, | |
1770 render_pass_size.width(), | |
1771 render_pass_size.height()); | |
1772 if (bitmap->allocPixels()) { | |
1773 bitmap->lockPixels(); | |
1774 GetFramebufferPixels(bitmap->getPixels(), gfx::Rect(render_pass_size)); | |
piman
2013/04/25 02:13:52
How hard would it be to add the flexibility, and a
danakj
2013/04/25 18:39:15
Flexibility is fine, pass around a struct with mor
| |
1775 bitmap->unlockPixels(); | |
1776 } | |
1777 } | |
1778 | |
1766 void GLRenderer::ToGLMatrix(float* gl_matrix, const gfx::Transform& transform) { | 1779 void GLRenderer::ToGLMatrix(float* gl_matrix, const gfx::Transform& transform) { |
1767 transform.matrix().asColMajorf(gl_matrix); | 1780 transform.matrix().asColMajorf(gl_matrix); |
1768 } | 1781 } |
1769 | 1782 |
1770 void GLRenderer::SetShaderQuadF(const gfx::QuadF& quad, int quad_location) { | 1783 void GLRenderer::SetShaderQuadF(const gfx::QuadF& quad, int quad_location) { |
1771 if (quad_location == -1) | 1784 if (quad_location == -1) |
1772 return; | 1785 return; |
1773 | 1786 |
1774 float point[8]; | 1787 float point[8]; |
1775 point[0] = quad.p1().x(); | 1788 point[0] = quad.p1().x(); |
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2571 resource_provider_->DeleteResource(on_demand_tile_raster_resource_id_); | 2584 resource_provider_->DeleteResource(on_demand_tile_raster_resource_id_); |
2572 | 2585 |
2573 ReleaseRenderPassTextures(); | 2586 ReleaseRenderPassTextures(); |
2574 } | 2587 } |
2575 | 2588 |
2576 bool GLRenderer::IsContextLost() { | 2589 bool GLRenderer::IsContextLost() { |
2577 return (context_->getGraphicsResetStatusARB() != GL_NO_ERROR); | 2590 return (context_->getGraphicsResetStatusARB() != GL_NO_ERROR); |
2578 } | 2591 } |
2579 | 2592 |
2580 } // namespace cc | 2593 } // namespace cc |
OLD | NEW |