| 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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } |
| OLD | NEW |