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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 112 |
113 GrPathRange* GrGLPathRendering::createPathRange(GrPathRange::PathGenerator* path
Generator, | 113 GrPathRange* GrGLPathRendering::createPathRange(GrPathRange::PathGenerator* path
Generator, |
114 const GrStyle& style) { | 114 const GrStyle& style) { |
115 return new GrGLPathRange(this->gpu(), pathGenerator, style); | 115 return new GrGLPathRange(this->gpu(), pathGenerator, style); |
116 } | 116 } |
117 | 117 |
118 void GrGLPathRendering::onStencilPath(const StencilPathArgs& args, const GrPath*
path) { | 118 void GrGLPathRendering::onStencilPath(const StencilPathArgs& args, const GrPath*
path) { |
119 GrGLGpu* gpu = this->gpu(); | 119 GrGLGpu* gpu = this->gpu(); |
120 SkASSERT(gpu->caps()->shaderCaps()->pathRenderingSupport()); | 120 SkASSERT(gpu->caps()->shaderCaps()->pathRenderingSupport()); |
121 gpu->flushColorWrite(false); | 121 gpu->flushColorWrite(false); |
122 gpu->flushDrawFace(GrPipelineBuilder::kBoth_DrawFace); | 122 gpu->flushDrawFace(GrDrawFace::kBoth); |
123 | 123 |
124 GrGLRenderTarget* rt = static_cast<GrGLRenderTarget*>(args.fRenderTarget); | 124 GrGLRenderTarget* rt = static_cast<GrGLRenderTarget*>(args.fRenderTarget); |
125 SkISize size = SkISize::Make(rt->width(), rt->height()); | 125 SkISize size = SkISize::Make(rt->width(), rt->height()); |
126 this->setProjectionMatrix(*args.fViewMatrix, size, rt->origin()); | 126 this->setProjectionMatrix(*args.fViewMatrix, size, rt->origin()); |
127 gpu->flushScissor(*args.fScissor, rt->getViewport(), rt->origin()); | 127 gpu->flushScissor(*args.fScissor, rt->getViewport(), rt->origin()); |
128 gpu->flushHWAAState(rt, args.fUseHWAA, true); | 128 gpu->flushHWAAState(rt, args.fUseHWAA, true); |
129 gpu->flushRenderTarget(rt, nullptr); | 129 gpu->flushRenderTarget(rt, nullptr); |
130 | 130 |
131 const GrGLPath* glPath = static_cast<const GrGLPath*>(path); | 131 const GrGLPath* glPath = static_cast<const GrGLPath*>(path); |
132 | 132 |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 testMask != fHWPathStencilSettings.front().fTestMask) { | 330 testMask != fHWPathStencilSettings.front().fTestMask) { |
331 GL_CALL(PathStencilFunc(GrToGLStencilFunc(test), ref, testMask)); | 331 GL_CALL(PathStencilFunc(GrToGLStencilFunc(test), ref, testMask)); |
332 } | 332 } |
333 fHWPathStencilSettings = stencilSettings; | 333 fHWPathStencilSettings = stencilSettings; |
334 } | 334 } |
335 } | 335 } |
336 | 336 |
337 inline GrGLGpu* GrGLPathRendering::gpu() { | 337 inline GrGLGpu* GrGLPathRendering::gpu() { |
338 return static_cast<GrGLGpu*>(fGpu); | 338 return static_cast<GrGLGpu*>(fGpu); |
339 } | 339 } |
OLD | NEW |