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 3044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3055 if (dstFBO) { | 3055 if (dstFBO) { |
3056 this->unbindTextureFromFBO(GR_GL_DRAW_FRAMEBUFFER); | 3056 this->unbindTextureFromFBO(GR_GL_DRAW_FRAMEBUFFER); |
3057 } | 3057 } |
3058 if (srcFBO) { | 3058 if (srcFBO) { |
3059 this->unbindTextureFromFBO(GR_GL_READ_FRAMEBUFFER); | 3059 this->unbindTextureFromFBO(GR_GL_READ_FRAMEBUFFER); |
3060 } | 3060 } |
3061 return true; | 3061 return true; |
3062 } | 3062 } |
3063 | 3063 |
3064 void GrGLGpu::xferBarrier(GrRenderTarget* rt, GrXferBarrierType type) { | 3064 void GrGLGpu::xferBarrier(GrRenderTarget* rt, GrXferBarrierType type) { |
| 3065 SkASSERT(type); |
3065 switch (type) { | 3066 switch (type) { |
3066 case kTexture_GrXferBarrierType: { | 3067 case kTexture_GrXferBarrierType: { |
3067 GrGLRenderTarget* glrt = static_cast<GrGLRenderTarget*>(rt); | 3068 GrGLRenderTarget* glrt = static_cast<GrGLRenderTarget*>(rt); |
3068 if (glrt->textureFBOID() != glrt->renderFBOID()) { | 3069 if (glrt->textureFBOID() != glrt->renderFBOID()) { |
3069 // The render target uses separate storage so no need for glText
ureBarrier. | 3070 // The render target uses separate storage so no need for glText
ureBarrier. |
3070 // FIXME: The render target will resolve automatically when its
texture is bound, | 3071 // FIXME: The render target will resolve automatically when its
texture is bound, |
3071 // but we could resolve only the bounds that will be read if we
do it here instead. | 3072 // but we could resolve only the bounds that will be read if we
do it here instead. |
3072 return; | 3073 return; |
3073 } | 3074 } |
3074 SkASSERT(this->caps()->textureBarrierSupport()); | 3075 SkASSERT(this->caps()->textureBarrierSupport()); |
3075 GL_CALL(TextureBarrier()); | 3076 GL_CALL(TextureBarrier()); |
3076 return; | 3077 return; |
3077 } | 3078 } |
3078 case kBlend_GrXferBarrierType: | 3079 case kBlend_GrXferBarrierType: |
3079 SkASSERT(GrCaps::kAdvanced_BlendEquationSupport == | 3080 SkASSERT(GrCaps::kAdvanced_BlendEquationSupport == |
3080 this->caps()->blendEquationSupport()); | 3081 this->caps()->blendEquationSupport()); |
3081 GL_CALL(BlendBarrier()); | 3082 GL_CALL(BlendBarrier()); |
3082 return; | 3083 return; |
| 3084 default: break; // placate compiler warnings that kNone not handled |
3083 } | 3085 } |
3084 } | 3086 } |
3085 | 3087 |
3086 void GrGLGpu::didAddGpuTraceMarker() { | 3088 void GrGLGpu::didAddGpuTraceMarker() { |
3087 if (this->caps()->gpuTracingSupport()) { | 3089 if (this->caps()->gpuTracingSupport()) { |
3088 const GrTraceMarkerSet& markerArray = this->getActiveTraceMarkers(); | 3090 const GrTraceMarkerSet& markerArray = this->getActiveTraceMarkers(); |
3089 SkString markerString = markerArray.toStringLast(); | 3091 SkString markerString = markerArray.toStringLast(); |
3090 #if GR_FORCE_GPU_TRACE_DEBUGGING | 3092 #if GR_FORCE_GPU_TRACE_DEBUGGING |
3091 SkDebugf("%s\n", markerString.c_str()); | 3093 SkDebugf("%s\n", markerString.c_str()); |
3092 #else | 3094 #else |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3194 this->setVertexArrayID(gpu, 0); | 3196 this->setVertexArrayID(gpu, 0); |
3195 } | 3197 } |
3196 int attrCount = gpu->glCaps().maxVertexAttributes(); | 3198 int attrCount = gpu->glCaps().maxVertexAttributes(); |
3197 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 3199 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
3198 fDefaultVertexArrayAttribState.resize(attrCount); | 3200 fDefaultVertexArrayAttribState.resize(attrCount); |
3199 } | 3201 } |
3200 attribState = &fDefaultVertexArrayAttribState; | 3202 attribState = &fDefaultVertexArrayAttribState; |
3201 } | 3203 } |
3202 return attribState; | 3204 return attribState; |
3203 } | 3205 } |
OLD | NEW |