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

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

Issue 1933053002: Use constexpr constructors of GrStencilSettings rather than hacky macro system (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comment Created 4 years, 7 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/batches/GrStencilAndCoverPathRenderer.cpp ('k') | src/gpu/gl/GrGLUtil.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 #include "GrGLGpu.h" 8 #include "GrGLGpu.h"
9 #include "GrGLBuffer.h" 9 #include "GrGLBuffer.h"
10 #include "GrGLGLSL.h" 10 #include "GrGLGLSL.h"
(...skipping 2886 matching lines...) Expand 10 before | Expand all | Expand 10 after
2897 static const GrGLenum gTable[] = { 2897 static const GrGLenum gTable[] = {
2898 GR_GL_KEEP, // kKeep_StencilOp 2898 GR_GL_KEEP, // kKeep_StencilOp
2899 GR_GL_REPLACE, // kReplace_StencilOp 2899 GR_GL_REPLACE, // kReplace_StencilOp
2900 GR_GL_INCR_WRAP, // kIncWrap_StencilOp 2900 GR_GL_INCR_WRAP, // kIncWrap_StencilOp
2901 GR_GL_INCR, // kIncClamp_StencilOp 2901 GR_GL_INCR, // kIncClamp_StencilOp
2902 GR_GL_DECR_WRAP, // kDecWrap_StencilOp 2902 GR_GL_DECR_WRAP, // kDecWrap_StencilOp
2903 GR_GL_DECR, // kDecClamp_StencilOp 2903 GR_GL_DECR, // kDecClamp_StencilOp
2904 GR_GL_ZERO, // kZero_StencilOp 2904 GR_GL_ZERO, // kZero_StencilOp
2905 GR_GL_INVERT, // kInvert_StencilOp 2905 GR_GL_INVERT, // kInvert_StencilOp
2906 }; 2906 };
2907 GR_STATIC_ASSERT(SK_ARRAY_COUNT(gTable) == kStencilOpCount); 2907 GR_STATIC_ASSERT(SK_ARRAY_COUNT(gTable) == kStencilOpCnt);
2908 GR_STATIC_ASSERT(0 == kKeep_StencilOp); 2908 GR_STATIC_ASSERT(0 == kKeep_StencilOp);
2909 GR_STATIC_ASSERT(1 == kReplace_StencilOp); 2909 GR_STATIC_ASSERT(1 == kReplace_StencilOp);
2910 GR_STATIC_ASSERT(2 == kIncWrap_StencilOp); 2910 GR_STATIC_ASSERT(2 == kIncWrap_StencilOp);
2911 GR_STATIC_ASSERT(3 == kIncClamp_StencilOp); 2911 GR_STATIC_ASSERT(3 == kIncClamp_StencilOp);
2912 GR_STATIC_ASSERT(4 == kDecWrap_StencilOp); 2912 GR_STATIC_ASSERT(4 == kDecWrap_StencilOp);
2913 GR_STATIC_ASSERT(5 == kDecClamp_StencilOp); 2913 GR_STATIC_ASSERT(5 == kDecClamp_StencilOp);
2914 GR_STATIC_ASSERT(6 == kZero_StencilOp); 2914 GR_STATIC_ASSERT(6 == kZero_StencilOp);
2915 GR_STATIC_ASSERT(7 == kInvert_StencilOp); 2915 GR_STATIC_ASSERT(7 == kInvert_StencilOp);
2916 SkASSERT((unsigned) op < kStencilOpCount); 2916 SkASSERT((unsigned) op < kStencilOpCnt);
2917 return gTable[op]; 2917 return gTable[op];
2918 } 2918 }
2919 2919
2920 void set_gl_stencil(const GrGLInterface* gl, 2920 void set_gl_stencil(const GrGLInterface* gl,
2921 const GrStencilSettings& settings, 2921 const GrStencilSettings& settings,
2922 GrGLenum glFace, 2922 GrGLenum glFace,
2923 GrStencilSettings::Face grFace) { 2923 GrStencilSettings::Face grFace) {
2924 GrGLenum glFunc = GrToGLStencilFunc(settings.func(grFace)); 2924 GrGLenum glFunc = GrToGLStencilFunc(settings.func(grFace));
2925 GrGLenum glFailOp = gr_to_gl_stencil_op(settings.failOp(grFace)); 2925 GrGLenum glFailOp = gr_to_gl_stencil_op(settings.failOp(grFace));
2926 GrGLenum glPassOp = gr_to_gl_stencil_op(settings.passOp(grFace)); 2926 GrGLenum glPassOp = gr_to_gl_stencil_op(settings.passOp(grFace));
(...skipping 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after
4271 if (GR_GL_TEXTURE_EXTERNAL == glTexture->target() || 4271 if (GR_GL_TEXTURE_EXTERNAL == glTexture->target() ||
4272 GR_GL_TEXTURE_RECTANGLE == glTexture->target()) { 4272 GR_GL_TEXTURE_RECTANGLE == glTexture->target()) {
4273 copyParams->fFilter = GrTextureParams::kNone_FilterMode; 4273 copyParams->fFilter = GrTextureParams::kNone_FilterMode;
4274 copyParams->fWidth = texture->width(); 4274 copyParams->fWidth = texture->width();
4275 copyParams->fHeight = texture->height(); 4275 copyParams->fHeight = texture->height();
4276 return true; 4276 return true;
4277 } 4277 }
4278 } 4278 }
4279 return false; 4279 return false;
4280 } 4280 }
OLDNEW
« no previous file with comments | « src/gpu/batches/GrStencilAndCoverPathRenderer.cpp ('k') | src/gpu/gl/GrGLUtil.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698