| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #ifndef GrPathRenderer_DEFINED | 8 #ifndef GrPathRenderer_DEFINED |
| 9 #define GrPathRenderer_DEFINED | 9 #define GrPathRenderer_DEFINED |
| 10 | 10 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 SkDEBUGCODE(args.validate();) | 104 SkDEBUGCODE(args.validate();) |
| 105 return this->onCanDrawPath(args); | 105 return this->onCanDrawPath(args); |
| 106 } | 106 } |
| 107 | 107 |
| 108 /** | 108 /** |
| 109 * Args to drawPath() | 109 * Args to drawPath() |
| 110 * | 110 * |
| 111 * fTarget The target that the path will be rendered to | 111 * fTarget The target that the path will be rendered to |
| 112 * fResourceProvider The resource provider for creating gpu resources t
o render the path | 112 * fResourceProvider The resource provider for creating gpu resources t
o render the path |
| 113 * fPipelineBuilder The pipelineBuilder | 113 * fPipelineBuilder The pipelineBuilder |
| 114 * fClip The clip |
| 114 * fColor Color to render with | 115 * fColor Color to render with |
| 115 * fViewMatrix The viewMatrix | 116 * fViewMatrix The viewMatrix |
| 116 * fPath the path to draw. | 117 * fPath the path to draw. |
| 117 * fStyle the style information (path effect, stroke info) | 118 * fStyle the style information (path effect, stroke info) |
| 118 * fAntiAlias true if anti-aliasing is required. | 119 * fAntiAlias true if anti-aliasing is required. |
| 119 * fGammaCorrect true if gamma-correct rendering is to be used. | 120 * fGammaCorrect true if gamma-correct rendering is to be used. |
| 120 */ | 121 */ |
| 121 struct DrawPathArgs { | 122 struct DrawPathArgs { |
| 122 GrDrawTarget* fTarget; | 123 GrDrawTarget* fTarget; |
| 123 GrResourceProvider* fResourceProvider; | 124 GrResourceProvider* fResourceProvider; |
| 124 GrPipelineBuilder* fPipelineBuilder; | 125 GrPipelineBuilder* fPipelineBuilder; |
| 126 const GrClip* fClip; |
| 125 GrColor fColor; | 127 GrColor fColor; |
| 126 const SkMatrix* fViewMatrix; | 128 const SkMatrix* fViewMatrix; |
| 127 const SkPath* fPath; | 129 const SkPath* fPath; |
| 128 const GrStyle* fStyle; | 130 const GrStyle* fStyle; |
| 129 bool fAntiAlias; | 131 bool fAntiAlias; |
| 130 bool fGammaCorrect; | 132 bool fGammaCorrect; |
| 131 | 133 |
| 132 void validate() const { | 134 void validate() const { |
| 133 SkASSERT(fTarget); | 135 SkASSERT(fTarget); |
| 134 SkASSERT(fResourceProvider); | 136 SkASSERT(fResourceProvider); |
| 135 SkASSERT(fPipelineBuilder); | 137 SkASSERT(fPipelineBuilder); |
| 138 SkASSERT(fClip); |
| 136 SkASSERT(fViewMatrix); | 139 SkASSERT(fViewMatrix); |
| 137 SkASSERT(fPath); | 140 SkASSERT(fPath); |
| 138 SkASSERT(fStyle); | 141 SkASSERT(fStyle); |
| 139 SkASSERT(!fPath->isEmpty()); | 142 SkASSERT(!fPath->isEmpty()); |
| 140 } | 143 } |
| 141 }; | 144 }; |
| 142 | 145 |
| 143 /** | 146 /** |
| 144 * Draws the path into the draw target. If getStencilSupport() would return
kNoRestriction then | 147 * Draws the path into the draw target. If getStencilSupport() would return
kNoRestriction then |
| 145 * the subclass must respect the stencil settings of the GrPipelineBuilder. | 148 * the subclass must respect the stencil settings of the GrPipelineBuilder. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 171 * fTarget The target that the path will be rendered to. | 174 * fTarget The target that the path will be rendered to. |
| 172 * fResourceProvider The resource provider for creating gpu resources t
o render the path | 175 * fResourceProvider The resource provider for creating gpu resources t
o render the path |
| 173 * fPipelineBuilder The pipeline builder. | 176 * fPipelineBuilder The pipeline builder. |
| 174 * fViewMatrix Matrix applied to the path. | 177 * fViewMatrix Matrix applied to the path. |
| 175 * fPath The path to draw. | 178 * fPath The path to draw. |
| 176 */ | 179 */ |
| 177 struct StencilPathArgs { | 180 struct StencilPathArgs { |
| 178 GrDrawTarget* fTarget; | 181 GrDrawTarget* fTarget; |
| 179 GrResourceProvider* fResourceProvider; | 182 GrResourceProvider* fResourceProvider; |
| 180 GrPipelineBuilder* fPipelineBuilder; | 183 GrPipelineBuilder* fPipelineBuilder; |
| 184 const GrClip* fClip; |
| 181 const SkMatrix* fViewMatrix; | 185 const SkMatrix* fViewMatrix; |
| 182 const SkPath* fPath; | 186 const SkPath* fPath; |
| 183 | 187 |
| 184 void validate() const { | 188 void validate() const { |
| 185 SkASSERT(fTarget); | 189 SkASSERT(fTarget); |
| 186 SkASSERT(fResourceProvider); | 190 SkASSERT(fResourceProvider); |
| 187 SkASSERT(fPipelineBuilder); | 191 SkASSERT(fPipelineBuilder); |
| 188 SkASSERT(fViewMatrix); | 192 SkASSERT(fViewMatrix); |
| 189 SkASSERT(fPath); | 193 SkASSERT(fPath); |
| 190 SkASSERT(!fPath->isEmpty()); | 194 SkASSERT(!fPath->isEmpty()); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 drawArgs.fStyle = &GrStyle::SimpleFill(); | 284 drawArgs.fStyle = &GrStyle::SimpleFill(); |
| 281 drawArgs.fAntiAlias = false; | 285 drawArgs.fAntiAlias = false; |
| 282 drawArgs.fGammaCorrect = false; | 286 drawArgs.fGammaCorrect = false; |
| 283 this->drawPath(drawArgs); | 287 this->drawPath(drawArgs); |
| 284 } | 288 } |
| 285 | 289 |
| 286 typedef SkRefCnt INHERITED; | 290 typedef SkRefCnt INHERITED; |
| 287 }; | 291 }; |
| 288 | 292 |
| 289 #endif | 293 #endif |
| OLD | NEW |