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 #include "GrDefaultPathRenderer.h" | 8 #include "GrDefaultPathRenderer.h" |
9 | 9 |
10 #include "GrBatch.h" | 10 #include "GrBatch.h" |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 fBatch.fUsesLocalCoords = init.fUsesLocalCoords; | 249 fBatch.fUsesLocalCoords = init.fUsesLocalCoords; |
250 fBatch.fCoverageIgnored = init.fCoverageIgnored; | 250 fBatch.fCoverageIgnored = init.fCoverageIgnored; |
251 } | 251 } |
252 | 252 |
253 void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline
) override { | 253 void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline
) override { |
254 SkAutoTUnref<const GrGeometryProcessor> gp( | 254 SkAutoTUnref<const GrGeometryProcessor> gp( |
255 GrDefaultGeoProcFactory::Create(GrDefaultGeoProcFactory::kPositi
on_GPType, | 255 GrDefaultGeoProcFactory::Create(GrDefaultGeoProcFactory::kPositi
on_GPType, |
256 this->color(), | 256 this->color(), |
257 this->viewMatrix(), | 257 this->viewMatrix(), |
258 SkMatrix::I(), | 258 SkMatrix::I(), |
259 false, | |
260 this->coverage())); | 259 this->coverage())); |
261 | 260 |
262 size_t vertexStride = gp->getVertexStride(); | 261 size_t vertexStride = gp->getVertexStride(); |
263 SkASSERT(vertexStride == sizeof(SkPoint)); | 262 SkASSERT(vertexStride == sizeof(SkPoint)); |
264 | 263 |
265 batchTarget->initDraw(gp, pipeline); | 264 batchTarget->initDraw(gp, pipeline); |
266 | 265 |
267 // TODO this is hacky, but the only way we have to initialize the GP is
to use the | 266 // TODO this is hacky, but the only way we have to initialize the GP is
to use the |
268 // GrPipelineInfo struct so we can generate the correct shader. Once we
have GrBatch | 267 // GrPipelineInfo struct so we can generate the correct shader. Once we
have GrBatch |
269 // everywhere we can remove this nastiness | 268 // everywhere we can remove this nastiness |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
767 geometry.fColor = color; | 766 geometry.fColor = color; |
768 geometry.fPath = path; | 767 geometry.fPath = path; |
769 geometry.fTolerance = srcSpaceTol; | 768 geometry.fTolerance = srcSpaceTol; |
770 | 769 |
771 viewMatrix.mapRect(&bounds); | 770 viewMatrix.mapRect(&bounds); |
772 uint8_t coverage = GrRandomCoverage(random); | 771 uint8_t coverage = GrRandomCoverage(random); |
773 return DefaultPathBatch::Create(geometry, coverage, viewMatrix, true, bounds
); | 772 return DefaultPathBatch::Create(geometry, coverage, viewMatrix, true, bounds
); |
774 } | 773 } |
775 | 774 |
776 #endif | 775 #endif |
OLD | NEW |