OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 | 8 |
9 #include "GrGLGpu.h" | 9 #include "GrGLGpu.h" |
10 #include "GrGLGLSL.h" | 10 #include "GrGLGLSL.h" |
(...skipping 2658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2669 } | 2669 } |
2670 | 2670 |
2671 void GrGLGpu::unbindTextureFromFBO(GrGLenum fboTarget) { | 2671 void GrGLGpu::unbindTextureFromFBO(GrGLenum fboTarget) { |
2672 GR_GL_CALL(this->glInterface(), FramebufferTexture2D(fboTarget, | 2672 GR_GL_CALL(this->glInterface(), FramebufferTexture2D(fboTarget, |
2673 GR_GL_COLOR_ATTACHMENT0
, | 2673 GR_GL_COLOR_ATTACHMENT0
, |
2674 GR_GL_TEXTURE_2D, | 2674 GR_GL_TEXTURE_2D, |
2675 0, | 2675 0, |
2676 0)); | 2676 0)); |
2677 } | 2677 } |
2678 | 2678 |
2679 bool GrGLGpu::initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc)
{ | 2679 bool GrGLGpu::initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc)
const { |
2680 // If the src is a texture, we can implement the blit as a draw assuming the
config is | 2680 // If the src is a texture, we can implement the blit as a draw assuming the
config is |
2681 // renderable. | 2681 // renderable. |
2682 if (src->asTexture() && this->caps()->isConfigRenderable(src->config(), fals
e)) { | 2682 if (src->asTexture() && this->caps()->isConfigRenderable(src->config(), fals
e)) { |
2683 desc->fOrigin = kDefault_GrSurfaceOrigin; | 2683 desc->fOrigin = kDefault_GrSurfaceOrigin; |
2684 desc->fFlags = kRenderTarget_GrSurfaceFlag; | 2684 desc->fFlags = kRenderTarget_GrSurfaceFlag; |
2685 desc->fConfig = src->config(); | 2685 desc->fConfig = src->config(); |
2686 return true; | 2686 return true; |
2687 } | 2687 } |
2688 | 2688 |
2689 // We look for opportunities to use CopyTexSubImage, or fbo blit. If neither
are | 2689 // We look for opportunities to use CopyTexSubImage, or fbo blit. If neither
are |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3156 this->setVertexArrayID(gpu, 0); | 3156 this->setVertexArrayID(gpu, 0); |
3157 } | 3157 } |
3158 int attrCount = gpu->glCaps().maxVertexAttributes(); | 3158 int attrCount = gpu->glCaps().maxVertexAttributes(); |
3159 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 3159 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
3160 fDefaultVertexArrayAttribState.resize(attrCount); | 3160 fDefaultVertexArrayAttribState.resize(attrCount); |
3161 } | 3161 } |
3162 attribState = &fDefaultVertexArrayAttribState; | 3162 attribState = &fDefaultVertexArrayAttribState; |
3163 } | 3163 } |
3164 return attribState; | 3164 return attribState; |
3165 } | 3165 } |
OLD | NEW |