| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include "GrAADistanceFieldPathRenderer.h" | 9 #include "GrAADistanceFieldPathRenderer.h" |
| 10 | 10 |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 } | 177 } |
| 178 | 178 |
| 179 uint32_t flags = 0; | 179 uint32_t flags = 0; |
| 180 flags |= this->viewMatrix().isSimilarity() ? kSimilarity_DistanceFieldEf
fectFlag : 0; | 180 flags |= this->viewMatrix().isSimilarity() ? kSimilarity_DistanceFieldEf
fectFlag : 0; |
| 181 | 181 |
| 182 GrTextureParams params(SkShader::kRepeat_TileMode, GrTextureParams::kBil
erp_FilterMode); | 182 GrTextureParams params(SkShader::kRepeat_TileMode, GrTextureParams::kBil
erp_FilterMode); |
| 183 | 183 |
| 184 // Setup GrGeometryProcessor | 184 // Setup GrGeometryProcessor |
| 185 GrBatchAtlas* atlas = fAtlas; | 185 GrBatchAtlas* atlas = fAtlas; |
| 186 SkAutoTUnref<GrGeometryProcessor> dfProcessor( | 186 SkAutoTUnref<GrGeometryProcessor> dfProcessor( |
| 187 GrDistanceFieldNoGammaTextureEffect::Create(this->color(), | 187 GrDistanceFieldPathGeoProc::Create(this->color(), |
| 188 this->viewMatrix(), | 188 this->viewMatrix(), |
| 189 atlas->getTexture(), | 189 atlas->getTexture(), |
| 190 params, | 190 params, |
| 191 flags, | 191 flags, |
| 192 false)); | 192 false)); |
| 193 | 193 |
| 194 this->initDraw(batchTarget, dfProcessor, pipeline); | 194 this->initDraw(batchTarget, dfProcessor, pipeline); |
| 195 | 195 |
| 196 // allocate vertices | 196 // allocate vertices |
| 197 size_t vertexStride = dfProcessor->getVertexStride(); | 197 size_t vertexStride = dfProcessor->getVertexStride(); |
| 198 SkASSERT(vertexStride == 2 * sizeof(SkPoint)); | 198 SkASSERT(vertexStride == 2 * sizeof(SkPoint)); |
| 199 | 199 |
| 200 int vertexCount = GrBatchTarget::kVertsPerRect * instanceCount; | 200 int vertexCount = GrBatchTarget::kVertsPerRect * instanceCount; |
| 201 | 201 |
| 202 const GrVertexBuffer* vertexBuffer; | 202 const GrVertexBuffer* vertexBuffer; |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 SkAutoTUnref<GrBatch> batch(AADistanceFieldPathBatch::Create(geometry, color
, viewMatrix, | 607 SkAutoTUnref<GrBatch> batch(AADistanceFieldPathBatch::Create(geometry, color
, viewMatrix, |
| 608 fAtlas, &fPathC
ache, &fPathList)); | 608 fAtlas, &fPathC
ache, &fPathList)); |
| 609 | 609 |
| 610 SkRect bounds = path.getBounds(); | 610 SkRect bounds = path.getBounds(); |
| 611 viewMatrix.mapRect(&bounds); | 611 viewMatrix.mapRect(&bounds); |
| 612 target->drawBatch(pipelineBuilder, batch, &bounds); | 612 target->drawBatch(pipelineBuilder, batch, &bounds); |
| 613 | 613 |
| 614 return true; | 614 return true; |
| 615 } | 615 } |
| 616 | 616 |
| OLD | NEW |