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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 } | 99 } |
100 | 100 |
101 void GrGLPathRendering::resetContext() { | 101 void GrGLPathRendering::resetContext() { |
102 fHWProjectionMatrixState.invalidate(); | 102 fHWProjectionMatrixState.invalidate(); |
103 // we don't use the model view matrix. | 103 // we don't use the model view matrix. |
104 GL_CALL(MatrixLoadIdentity(GR_GL_PATH_MODELVIEW)); | 104 GL_CALL(MatrixLoadIdentity(GR_GL_PATH_MODELVIEW)); |
105 | 105 |
106 fHWPathStencilSettings.invalidate(); | 106 fHWPathStencilSettings.invalidate(); |
107 } | 107 } |
108 | 108 |
109 GrPath* GrGLPathRendering::createPath(const SkPath& inPath, const GrStyle& style
) { | 109 GrPath* GrGLPathRendering::createPath(const SkPath& inPath, const GrStrokeInfo&
stroke) { |
110 return new GrGLPath(this->gpu(), inPath, style); | 110 return new GrGLPath(this->gpu(), inPath, stroke); |
111 } | 111 } |
112 | 112 |
113 GrPathRange* GrGLPathRendering::createPathRange(GrPathRange::PathGenerator* path
Generator, | 113 GrPathRange* GrGLPathRendering::createPathRange(GrPathRange::PathGenerator* path
Generator, |
114 const GrStyle& style) { | 114 const GrStrokeInfo& stroke) { |
115 return new GrGLPathRange(this->gpu(), pathGenerator, style); | 115 return new GrGLPathRange(this->gpu(), pathGenerator, stroke); |
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(GrPipelineBuilder::kBoth_DrawFace); |
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()); |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 funcMask != fHWPathStencilSettings.funcMask(kFront_Face)) { | 333 funcMask != fHWPathStencilSettings.funcMask(kFront_Face)) { |
334 GL_CALL(PathStencilFunc(GrToGLStencilFunc(func), funcRef, funcMask))
; | 334 GL_CALL(PathStencilFunc(GrToGLStencilFunc(func), funcRef, funcMask))
; |
335 } | 335 } |
336 fHWPathStencilSettings = stencilSettings; | 336 fHWPathStencilSettings = stencilSettings; |
337 } | 337 } |
338 } | 338 } |
339 | 339 |
340 inline GrGLGpu* GrGLPathRendering::gpu() { | 340 inline GrGLGpu* GrGLPathRendering::gpu() { |
341 return static_cast<GrGLGpu*>(fGpu); | 341 return static_cast<GrGLGpu*>(fGpu); |
342 } | 342 } |
OLD | NEW |