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

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

Issue 1619623005: Avoid updating glPathStencilFunc unless it changes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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
« src/gpu/GrStencil.h ('K') | « src/gpu/GrStencil.h ('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 2014 Google Inc. 2 * Copyright 2014 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 "gl/GrGLPathRendering.h" 8 #include "gl/GrGLPathRendering.h"
9 #include "gl/GrGLUtil.h" 9 #include "gl/GrGLUtil.h"
10 #include "gl/GrGLGpu.h" 10 #include "gl/GrGLGpu.h"
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 } 286 }
287 287
288 void GrGLPathRendering::deletePaths(GrGLuint path, GrGLsizei range) { 288 void GrGLPathRendering::deletePaths(GrGLuint path, GrGLsizei range) {
289 GL_CALL(DeletePaths(path, range)); 289 GL_CALL(DeletePaths(path, range));
290 } 290 }
291 291
292 void GrGLPathRendering::flushPathStencilSettings(const GrStencilSettings& stenci lSettings) { 292 void GrGLPathRendering::flushPathStencilSettings(const GrStencilSettings& stenci lSettings) {
293 if (fHWPathStencilSettings != stencilSettings) { 293 if (fHWPathStencilSettings != stencilSettings) {
294 // Just the func, ref, and mask is set here. The op and write mask are p arams to the call 294 // Just the func, ref, and mask is set here. The op and write mask are p arams to the call
295 // that draws the path to the SB (glStencilFillPath) 295 // that draws the path to the SB (glStencilFillPath)
296 GrGLenum func = 296 const GrStencilSettings::Face kFace = GrStencilSettings::kFront_Face;
297 GrToGLStencilFunc(stencilSettings.func(GrStencilSettings::kFront_Fac e)); 297 GrStencilFunc func = stencilSettings.func(kFace);
298 GL_CALL(PathStencilFunc(func, stencilSettings.funcRef(GrStencilSettings: :kFront_Face), 298 uint16_t funcRef = stencilSettings.funcRef(kFace);
299 stencilSettings.funcMask(GrStencilSettings::kFro nt_Face))); 299 uint16_t funcMask = stencilSettings.funcMask(kFace);
300 300
301 if (!fHWPathStencilSettings.isValid() ||
302 func != fHWPathStencilSettings.func(kFace) ||
303 funcRef != fHWPathStencilSettings.funcRef(kFace) ||
304 funcMask != fHWPathStencilSettings.funcMask(kFace)) {
305 GL_CALL(PathStencilFunc(GrToGLStencilFunc(func), funcRef, funcMask)) ;
306 }
301 fHWPathStencilSettings = stencilSettings; 307 fHWPathStencilSettings = stencilSettings;
302 } 308 }
303 } 309 }
304 310
305 inline GrGLGpu* GrGLPathRendering::gpu() { 311 inline GrGLGpu* GrGLPathRendering::gpu() {
306 return static_cast<GrGLGpu*>(fGpu); 312 return static_cast<GrGLGpu*>(fGpu);
307 } 313 }
OLDNEW
« src/gpu/GrStencil.h ('K') | « src/gpu/GrStencil.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698