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 #ifndef GrPathRendering_DEFINED | 8 #ifndef GrPathRendering_DEFINED |
9 #define GrPathRendering_DEFINED | 9 #define GrPathRendering_DEFINED |
10 | 10 |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 this->onDrawPath(args, path); | 172 this->onDrawPath(args, path); |
173 } | 173 } |
174 | 174 |
175 void drawPaths(const DrawPathArgs& args, const GrPathRange* pathRange, const
void* indices, | 175 void drawPaths(const DrawPathArgs& args, const GrPathRange* pathRange, const
void* indices, |
176 PathIndexType indexType, const float transformValues[], | 176 PathIndexType indexType, const float transformValues[], |
177 PathTransformType transformType, int count) { | 177 PathTransformType transformType, int count) { |
178 fGpu->handleDirtyContext(); | 178 fGpu->handleDirtyContext(); |
179 if (GrXferBarrierType barrierType = args.fPipeline->xferBarrierType(*fGp
u->caps())) { | 179 if (GrXferBarrierType barrierType = args.fPipeline->xferBarrierType(*fGp
u->caps())) { |
180 fGpu->xferBarrier(args.fPipeline->getRenderTarget(), barrierType); | 180 fGpu->xferBarrier(args.fPipeline->getRenderTarget(), barrierType); |
181 } | 181 } |
182 pathRange->willDrawPaths(indices, indexType, count); | 182 #ifdef SK_DEBUG |
| 183 pathRange->assertPathsLoaded(indices, indexType, count); |
| 184 #endif |
183 this->onDrawPaths(args, pathRange, indices, indexType, transformValues,
transformType, | 185 this->onDrawPaths(args, pathRange, indices, indexType, transformValues,
transformType, |
184 count); | 186 count); |
185 } | 187 } |
186 | 188 |
187 protected: | 189 protected: |
188 GrPathRendering(GrGpu* gpu) | 190 GrPathRendering(GrGpu* gpu) |
189 : fGpu(gpu) { | 191 : fGpu(gpu) { |
190 } | 192 } |
191 virtual void onStencilPath(const StencilPathArgs&, const GrPath*) = 0; | 193 virtual void onStencilPath(const StencilPathArgs&, const GrPath*) = 0; |
192 virtual void onDrawPath(const DrawPathArgs&, const GrPath*) = 0; | 194 virtual void onDrawPath(const DrawPathArgs&, const GrPath*) = 0; |
193 virtual void onDrawPaths(const DrawPathArgs&, const GrPathRange*, const void
*, PathIndexType, | 195 virtual void onDrawPaths(const DrawPathArgs&, const GrPathRange*, const void
*, PathIndexType, |
194 const float[], PathTransformType, int) = 0; | 196 const float[], PathTransformType, int) = 0; |
195 | 197 |
196 GrGpu* fGpu; | 198 GrGpu* fGpu; |
197 private: | 199 private: |
198 GrPathRendering& operator=(const GrPathRendering&); | 200 GrPathRendering& operator=(const GrPathRendering&); |
199 }; | 201 }; |
200 | 202 |
201 #endif | 203 #endif |
OLD | NEW |