| 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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 return true; | 309 return true; |
| 310 } | 310 } |
| 311 | 311 |
| 312 bool GrAADistanceFieldPathRenderer::internalDrawPath(GrDrawTarget* target, | 312 bool GrAADistanceFieldPathRenderer::internalDrawPath(GrDrawTarget* target, |
| 313 GrPipelineBuilder* pipeline
Builder, | 313 GrPipelineBuilder* pipeline
Builder, |
| 314 GrColor color, | 314 GrColor color, |
| 315 const SkMatrix& viewMatrix, | 315 const SkMatrix& viewMatrix, |
| 316 const SkPath& path, | 316 const SkPath& path, |
| 317 const PathData* pathData) { | 317 const PathData* pathData) { |
| 318 GrTexture* texture = fAtlas->getTexture(); | 318 GrTexture* texture = fAtlas->getTexture(); |
| 319 GrPipelineBuilder::AutoRestoreEffects are(pipelineBuilder); | 319 GrPipelineBuilder::AutoRestoreFragmentProcessors arfp(pipelineBuilder); |
| 320 | 320 |
| 321 SkASSERT(pathData->fPlot); | 321 SkASSERT(pathData->fPlot); |
| 322 GrDrawTarget::DrawToken drawToken = target->getCurrentDrawToken(); | 322 GrDrawTarget::DrawToken drawToken = target->getCurrentDrawToken(); |
| 323 pathData->fPlot->setDrawToken(drawToken); | 323 pathData->fPlot->setDrawToken(drawToken); |
| 324 | 324 |
| 325 // set up any flags | 325 // set up any flags |
| 326 uint32_t flags = 0; | 326 uint32_t flags = 0; |
| 327 flags |= viewMatrix.isSimilarity() ? kSimilarity_DistanceFieldEffectFlag : 0
; | 327 flags |= viewMatrix.isSimilarity() ? kSimilarity_DistanceFieldEffectFlag : 0
; |
| 328 | 328 |
| 329 GrTextureParams params(SkShader::kRepeat_TileMode, GrTextureParams::kBilerp_
FilterMode); | 329 GrTextureParams params(SkShader::kRepeat_TileMode, GrTextureParams::kBilerp_
FilterMode); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 | 378 |
| 379 viewMatrix.mapRect(&r); | 379 viewMatrix.mapRect(&r); |
| 380 target->setIndexSourceToBuffer(fContext->getQuadIndexBuffer()); | 380 target->setIndexSourceToBuffer(fContext->getQuadIndexBuffer()); |
| 381 target->drawIndexedInstances(pipelineBuilder, fCachedGeometryProcessor.get()
, | 381 target->drawIndexedInstances(pipelineBuilder, fCachedGeometryProcessor.get()
, |
| 382 kTriangles_GrPrimitiveType, 1, 4, 6, &r); | 382 kTriangles_GrPrimitiveType, 1, 4, 6, &r); |
| 383 target->resetVertexSource(); | 383 target->resetVertexSource(); |
| 384 | 384 |
| 385 return true; | 385 return true; |
| 386 } | 386 } |
| 387 | 387 |
| OLD | NEW |