| 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 GrTextureParams params(SkShader::kRepeat_TileMode, GrTextureParams::kBil
erp_FilterMode); | 177 GrTextureParams params(SkShader::kRepeat_TileMode, GrTextureParams::kBil
erp_FilterMode); |
| 178 | 178 |
| 179 // Setup GrGeometryProcessor | 179 // Setup GrGeometryProcessor |
| 180 GrBatchAtlas* atlas = fAtlas; | 180 GrBatchAtlas* atlas = fAtlas; |
| 181 SkAutoTUnref<GrGeometryProcessor> dfProcessor( | 181 SkAutoTUnref<GrGeometryProcessor> dfProcessor( |
| 182 GrDistanceFieldPathGeoProc::Create(this->color(), | 182 GrDistanceFieldPathGeoProc::Create(this->color(), |
| 183 this->viewMatrix(), | 183 this->viewMatrix(), |
| 184 atlas->getTexture(), | 184 atlas->getTexture(), |
| 185 params, | 185 params, |
| 186 flags, | 186 flags, |
| 187 this->usesLocalCoords())); | 187 this->usesLocalCoords(), this
->rt2())); |
| 188 | 188 |
| 189 target->initDraw(dfProcessor, this->pipeline()); | 189 target->initDraw(dfProcessor, this->pipeline()); |
| 190 | 190 |
| 191 FlushInfo flushInfo; | 191 FlushInfo flushInfo; |
| 192 | 192 |
| 193 // allocate vertices | 193 // allocate vertices |
| 194 size_t vertexStride = dfProcessor->getVertexStride(); | 194 size_t vertexStride = dfProcessor->getVertexStride(); |
| 195 SkASSERT(vertexStride == 2 * sizeof(SkPoint)); | 195 SkASSERT(vertexStride == 2 * sizeof(SkPoint)); |
| 196 | 196 |
| 197 const GrVertexBuffer* vertexBuffer; | 197 const GrVertexBuffer* vertexBuffer; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 args.fPath, | 246 args.fPath, |
| 247 args.fStroke, | 247 args.fStroke, |
| 248 args.fAntiAlias, | 248 args.fAntiAlias, |
| 249 desiredDimension, | 249 desiredDimension, |
| 250 scale)) { | 250 scale)) { |
| 251 SkDebugf("Can't rasterize path\n"); | 251 SkDebugf("Can't rasterize path\n"); |
| 252 return; | 252 return; |
| 253 } | 253 } |
| 254 } | 254 } |
| 255 | 255 |
| 256 atlas->setLastUseToken(args.fPathData->fID, target->currentToken()); | 256 atlas->setLastUseToken(args.fPathData->fID, target->currentToken1())
; |
| 257 | 257 |
| 258 // Now set vertices | 258 // Now set vertices |
| 259 intptr_t offset = reinterpret_cast<intptr_t>(vertices); | 259 intptr_t offset = reinterpret_cast<intptr_t>(vertices); |
| 260 offset += i * kVerticesPerQuad * vertexStride; | 260 offset += i * kVerticesPerQuad * vertexStride; |
| 261 SkPoint* positions = reinterpret_cast<SkPoint*>(offset); | 261 SkPoint* positions = reinterpret_cast<SkPoint*>(offset); |
| 262 this->writePathVertices(target, | 262 this->writePathVertices(target, |
| 263 atlas, | 263 atlas, |
| 264 this->pipeline(), | 264 this->pipeline(), |
| 265 dfProcessor, | 265 dfProcessor, |
| 266 positions, | 266 positions, |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 621 geometry.fPath = GrTest::TestPath(random); | 621 geometry.fPath = GrTest::TestPath(random); |
| 622 geometry.fAntiAlias = random->nextBool(); | 622 geometry.fAntiAlias = random->nextBool(); |
| 623 | 623 |
| 624 return AADistanceFieldPathBatch::Create(geometry, color, viewMatrix, | 624 return AADistanceFieldPathBatch::Create(geometry, color, viewMatrix, |
| 625 gTestStruct.fAtlas, | 625 gTestStruct.fAtlas, |
| 626 &gTestStruct.fPathCache, | 626 &gTestStruct.fPathCache, |
| 627 &gTestStruct.fPathList); | 627 &gTestStruct.fPathList); |
| 628 } | 628 } |
| 629 | 629 |
| 630 #endif | 630 #endif |
| OLD | NEW |