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 3062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3073 } | 3073 } |
3074 case kBlend_GrXferBarrierType: | 3074 case kBlend_GrXferBarrierType: |
3075 SkASSERT(GrCaps::kAdvanced_BlendEquationSupport == | 3075 SkASSERT(GrCaps::kAdvanced_BlendEquationSupport == |
3076 this->caps()->blendEquationSupport()); | 3076 this->caps()->blendEquationSupport()); |
3077 GL_CALL(BlendBarrier()); | 3077 GL_CALL(BlendBarrier()); |
3078 return; | 3078 return; |
3079 default: break; // placate compiler warnings that kNone not handled | 3079 default: break; // placate compiler warnings that kNone not handled |
3080 } | 3080 } |
3081 } | 3081 } |
3082 | 3082 |
3083 void GrGLGpu::didAddGpuTraceMarker() { | |
3084 if (this->caps()->gpuTracingSupport()) { | |
3085 const GrTraceMarkerSet& markerArray = this->getActiveTraceMarkers(); | |
3086 SkString markerString = markerArray.toStringLast(); | |
3087 #if GR_FORCE_GPU_TRACE_DEBUGGING | |
3088 SkDebugf("%s\n", markerString.c_str()); | |
3089 #else | |
3090 GL_CALL(PushGroupMarker(0, markerString.c_str())); | |
3091 #endif | |
3092 } | |
3093 } | |
3094 | |
3095 void GrGLGpu::didRemoveGpuTraceMarker() { | |
3096 if (this->caps()->gpuTracingSupport()) { | |
3097 #if GR_FORCE_GPU_TRACE_DEBUGGING | |
3098 SkDebugf("Pop trace marker.\n"); | |
3099 #else | |
3100 GL_CALL(PopGroupMarker()); | |
3101 #endif | |
3102 } | |
3103 } | |
3104 | |
3105 GrBackendObject GrGLGpu::createTestingOnlyBackendTexture(void* pixels, int w, in
t h, | 3083 GrBackendObject GrGLGpu::createTestingOnlyBackendTexture(void* pixels, int w, in
t h, |
3106 GrPixelConfig config) const { | 3084 GrPixelConfig config) const { |
3107 GrGLuint texID; | 3085 GrGLuint texID; |
3108 GL_CALL(GenTextures(1, &texID)); | 3086 GL_CALL(GenTextures(1, &texID)); |
3109 GL_CALL(ActiveTexture(GR_GL_TEXTURE0)); | 3087 GL_CALL(ActiveTexture(GR_GL_TEXTURE0)); |
3110 GL_CALL(PixelStorei(GR_GL_UNPACK_ALIGNMENT, 1)); | 3088 GL_CALL(PixelStorei(GR_GL_UNPACK_ALIGNMENT, 1)); |
3111 GL_CALL(BindTexture(GR_GL_TEXTURE_2D, texID)); | 3089 GL_CALL(BindTexture(GR_GL_TEXTURE_2D, texID)); |
3112 GL_CALL(TexParameteri(GR_GL_TEXTURE_2D, GR_GL_TEXTURE_MAG_FILTER, GR_GL_NEAR
EST)); | 3090 GL_CALL(TexParameteri(GR_GL_TEXTURE_2D, GR_GL_TEXTURE_MAG_FILTER, GR_GL_NEAR
EST)); |
3113 GL_CALL(TexParameteri(GR_GL_TEXTURE_2D, GR_GL_TEXTURE_MIN_FILTER, GR_GL_NEAR
EST)); | 3091 GL_CALL(TexParameteri(GR_GL_TEXTURE_2D, GR_GL_TEXTURE_MIN_FILTER, GR_GL_NEAR
EST)); |
3114 GL_CALL(TexParameteri(GR_GL_TEXTURE_2D, GR_GL_TEXTURE_WRAP_S, GR_GL_CLAMP_TO
_EDGE)); | 3092 GL_CALL(TexParameteri(GR_GL_TEXTURE_2D, GR_GL_TEXTURE_WRAP_S, GR_GL_CLAMP_TO
_EDGE)); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3191 this->setVertexArrayID(gpu, 0); | 3169 this->setVertexArrayID(gpu, 0); |
3192 } | 3170 } |
3193 int attrCount = gpu->glCaps().maxVertexAttributes(); | 3171 int attrCount = gpu->glCaps().maxVertexAttributes(); |
3194 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 3172 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
3195 fDefaultVertexArrayAttribState.resize(attrCount); | 3173 fDefaultVertexArrayAttribState.resize(attrCount); |
3196 } | 3174 } |
3197 attribState = &fDefaultVertexArrayAttribState; | 3175 attribState = &fDefaultVertexArrayAttribState; |
3198 } | 3176 } |
3199 return attribState; | 3177 return attribState; |
3200 } | 3178 } |
OLD | NEW |