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

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: eh Created 4 years, 10 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/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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 } 284 }
285 return firstID; 285 return firstID;
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 SkASSERT(stencilSettings.isValid());
294 // Just the func, ref, and mask is set here. The op and write mask are p arams to the call 295 // 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) 296 // that draws the path to the SB (glStencilFillPath)
296 GrGLenum func = 297 const GrStencilSettings::Face kFront_Face = GrStencilSettings::kFront_Fa ce;
297 GrToGLStencilFunc(stencilSettings.func(GrStencilSettings::kFront_Fac e)); 298 GrStencilFunc func = stencilSettings.func(kFront_Face);
298 GL_CALL(PathStencilFunc(func, stencilSettings.funcRef(GrStencilSettings: :kFront_Face), 299 uint16_t funcRef = stencilSettings.funcRef(kFront_Face);
299 stencilSettings.funcMask(GrStencilSettings::kFro nt_Face))); 300 uint16_t funcMask = stencilSettings.funcMask(kFront_Face);
300 301
302 if (!fHWPathStencilSettings.isValid() ||
303 func != fHWPathStencilSettings.func(kFront_Face) ||
304 funcRef != fHWPathStencilSettings.funcRef(kFront_Face) ||
305 funcMask != fHWPathStencilSettings.funcMask(kFront_Face)) {
306 GL_CALL(PathStencilFunc(GrToGLStencilFunc(func), funcRef, funcMask)) ;
307 }
301 fHWPathStencilSettings = stencilSettings; 308 fHWPathStencilSettings = stencilSettings;
302 } 309 }
303 } 310 }
304 311
305 inline GrGLGpu* GrGLPathRendering::gpu() { 312 inline GrGLGpu* GrGLPathRendering::gpu() {
306 return static_cast<GrGLGpu*>(fGpu); 313 return static_cast<GrGLGpu*>(fGpu);
307 } 314 }
OLDNEW
« no previous file with comments | « src/gpu/GrStencil.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698