OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |