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

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

Issue 1288923005: Use stencil ops that don't issue writes whenever possible (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/GrStencilAndCoverTextContext.cpp ('k') | no next file » | 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 2100 matching lines...) Expand 10 before | Expand all | Expand 10 after
2111 2111
2112 GrGLint ref = settings.funcRef(grFace); 2112 GrGLint ref = settings.funcRef(grFace);
2113 GrGLint mask = settings.funcMask(grFace); 2113 GrGLint mask = settings.funcMask(grFace);
2114 GrGLint writeMask = settings.writeMask(grFace); 2114 GrGLint writeMask = settings.writeMask(grFace);
2115 2115
2116 if (GR_GL_FRONT_AND_BACK == glFace) { 2116 if (GR_GL_FRONT_AND_BACK == glFace) {
2117 // we call the combined func just in case separate stencil is not 2117 // we call the combined func just in case separate stencil is not
2118 // supported. 2118 // supported.
2119 GR_GL_CALL(gl, StencilFunc(glFunc, ref, mask)); 2119 GR_GL_CALL(gl, StencilFunc(glFunc, ref, mask));
2120 GR_GL_CALL(gl, StencilMask(writeMask)); 2120 GR_GL_CALL(gl, StencilMask(writeMask));
2121 GR_GL_CALL(gl, StencilOp(glFailOp, glPassOp, glPassOp)); 2121 GR_GL_CALL(gl, StencilOp(glFailOp, GR_GL_KEEP, glPassOp));
Chris Dalton 2015/08/18 19:33:11 I'm not sure it seems correct to modify this part.
vbuzinov 2015/08/21 12:16:57 Chris, stencil settings don't contain a separate v
2122 } else { 2122 } else {
2123 GR_GL_CALL(gl, StencilFuncSeparate(glFace, glFunc, ref, mask)); 2123 GR_GL_CALL(gl, StencilFuncSeparate(glFace, glFunc, ref, mask));
2124 GR_GL_CALL(gl, StencilMaskSeparate(glFace, writeMask)); 2124 GR_GL_CALL(gl, StencilMaskSeparate(glFace, writeMask));
2125 GR_GL_CALL(gl, StencilOpSeparate(glFace, glFailOp, glPassOp, glPassOp)); 2125 GR_GL_CALL(gl, StencilOpSeparate(glFace, glFailOp, GR_GL_KEEP, glPassOp) );
2126 } 2126 }
2127 } 2127 }
2128 } 2128 }
2129 2129
2130 void GrGLGpu::flushStencil(const GrStencilSettings& stencilSettings) { 2130 void GrGLGpu::flushStencil(const GrStencilSettings& stencilSettings) {
2131 if (fHWStencilSettings != stencilSettings) { 2131 if (fHWStencilSettings != stencilSettings) {
2132 if (stencilSettings.isDisabled()) { 2132 if (stencilSettings.isDisabled()) {
2133 if (kNo_TriState != fHWStencilTestEnabled) { 2133 if (kNo_TriState != fHWStencilTestEnabled) {
2134 GL_CALL(Disable(GR_GL_STENCIL_TEST)); 2134 GL_CALL(Disable(GR_GL_STENCIL_TEST));
2135 fHWStencilTestEnabled = kNo_TriState; 2135 fHWStencilTestEnabled = kNo_TriState;
(...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after
3196 this->setVertexArrayID(gpu, 0); 3196 this->setVertexArrayID(gpu, 0);
3197 } 3197 }
3198 int attrCount = gpu->glCaps().maxVertexAttributes(); 3198 int attrCount = gpu->glCaps().maxVertexAttributes();
3199 if (fDefaultVertexArrayAttribState.count() != attrCount) { 3199 if (fDefaultVertexArrayAttribState.count() != attrCount) {
3200 fDefaultVertexArrayAttribState.resize(attrCount); 3200 fDefaultVertexArrayAttribState.resize(attrCount);
3201 } 3201 }
3202 attribState = &fDefaultVertexArrayAttribState; 3202 attribState = &fDefaultVertexArrayAttribState;
3203 } 3203 }
3204 return attribState; 3204 return attribState;
3205 } 3205 }
OLDNEW
« no previous file with comments | « src/gpu/GrStencilAndCoverTextContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698