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/GrGLNameAllocator.h" | 9 #include "gl/GrGLNameAllocator.h" |
10 #include "gl/GrGLUtil.h" | 10 #include "gl/GrGLUtil.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 void GrGLPathRendering::onStencilPath(const StencilPathArgs& args, const GrPath*
path) { | 93 void GrGLPathRendering::onStencilPath(const StencilPathArgs& args, const GrPath*
path) { |
94 GrGLGpu* gpu = this->gpu(); | 94 GrGLGpu* gpu = this->gpu(); |
95 SkASSERT(gpu->caps()->shaderCaps()->pathRenderingSupport()); | 95 SkASSERT(gpu->caps()->shaderCaps()->pathRenderingSupport()); |
96 gpu->flushColorWrite(false); | 96 gpu->flushColorWrite(false); |
97 gpu->flushDrawFace(GrPipelineBuilder::kBoth_DrawFace); | 97 gpu->flushDrawFace(GrPipelineBuilder::kBoth_DrawFace); |
98 | 98 |
99 GrGLRenderTarget* rt = static_cast<GrGLRenderTarget*>(args.fRenderTarget); | 99 GrGLRenderTarget* rt = static_cast<GrGLRenderTarget*>(args.fRenderTarget); |
100 SkISize size = SkISize::Make(rt->width(), rt->height()); | 100 SkISize size = SkISize::Make(rt->width(), rt->height()); |
101 this->setProjectionMatrix(*args.fViewMatrix, size, rt->origin()); | 101 this->setProjectionMatrix(*args.fViewMatrix, size, rt->origin()); |
102 gpu->flushScissor(*args.fScissor, rt->getViewport(), rt->origin()); | 102 gpu->flushScissor(*args.fScissor, rt->getViewport(), rt->origin()); |
103 gpu->flushHWAAState(rt, args.fUseHWAA, true); | 103 gpu->flushHWAAState(rt, args.fUseHWAA); |
104 gpu->flushRenderTarget(rt, nullptr); | 104 gpu->flushRenderTarget(rt, nullptr); |
105 | 105 |
106 const GrGLPath* glPath = static_cast<const GrGLPath*>(path); | 106 const GrGLPath* glPath = static_cast<const GrGLPath*>(path); |
107 | 107 |
108 this->flushPathStencilSettings(*args.fStencil); | 108 this->flushPathStencilSettings(*args.fStencil); |
109 SkASSERT(!fHWPathStencilSettings.isTwoSided()); | 109 SkASSERT(!fHWPathStencilSettings.isTwoSided()); |
110 | 110 |
111 GrGLenum fillMode = gr_stencil_op_to_gl_path_rendering_fill_mode( | 111 GrGLenum fillMode = gr_stencil_op_to_gl_path_rendering_fill_mode( |
112 fHWPathStencilSettings.passOp(GrStencilSettings::kFront_Face)); | 112 fHWPathStencilSettings.passOp(GrStencilSettings::kFront_Face)); |
113 GrGLint writeMask = fHWPathStencilSettings.writeMask(GrStencilSettings::kFro
nt_Face); | 113 GrGLint writeMask = fHWPathStencilSettings.writeMask(GrStencilSettings::kFro
nt_Face); |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 GL_CALL(PathStencilFunc(func, stencilSettings.funcRef(GrStencilSettings:
:kFront_Face), | 289 GL_CALL(PathStencilFunc(func, stencilSettings.funcRef(GrStencilSettings:
:kFront_Face), |
290 stencilSettings.funcMask(GrStencilSettings::kFro
nt_Face))); | 290 stencilSettings.funcMask(GrStencilSettings::kFro
nt_Face))); |
291 | 291 |
292 fHWPathStencilSettings = stencilSettings; | 292 fHWPathStencilSettings = stencilSettings; |
293 } | 293 } |
294 } | 294 } |
295 | 295 |
296 inline GrGLGpu* GrGLPathRendering::gpu() { | 296 inline GrGLGpu* GrGLPathRendering::gpu() { |
297 return static_cast<GrGLGpu*>(fGpu); | 297 return static_cast<GrGLGpu*>(fGpu); |
298 } | 298 } |
OLD | NEW |