Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(215)

Side by Side Diff: src/gpu/gl/GrGLGpu.cpp

Issue 1287973003: Check for xfer barriers in GrBatch, auto-issue barriers in GrGpu (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comment Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/gl/GrGLGpu.h ('k') | tests/GrPorterDuffTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLGpu.h ('k') | tests/GrPorterDuffTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698