| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 128 |
| 129 GrAADistanceFieldPathRenderer::PathData* GrAADistanceFieldPathRenderer::addPathT
oAtlas( | 129 GrAADistanceFieldPathRenderer::PathData* GrAADistanceFieldPathRenderer::addPathT
oAtlas( |
| 130 const Sk
Path& path, | 130 const Sk
Path& path, |
| 131 const Sk
StrokeRec& stroke, | 131 const Sk
StrokeRec& stroke, |
| 132 bool ant
iAlias) { | 132 bool ant
iAlias) { |
| 133 | 133 |
| 134 // generate distance field and add to atlas | 134 // generate distance field and add to atlas |
| 135 if (NULL == fAtlas) { | 135 if (NULL == fAtlas) { |
| 136 SkISize textureSize = SkISize::Make(ATLAS_TEXTURE_WIDTH, ATLAS_TEXTURE_H
EIGHT); | 136 SkISize textureSize = SkISize::Make(ATLAS_TEXTURE_WIDTH, ATLAS_TEXTURE_H
EIGHT); |
| 137 fAtlas = SkNEW_ARGS(GrAtlas, (fContext->getGpu(), kAlpha_8_GrPixelConfig
, | 137 fAtlas = SkNEW_ARGS(GrAtlas, (fContext->getGpu(), kAlpha_8_GrPixelConfig
, |
| 138 kNone_GrTextureFlags, textureSize, | 138 kNone_GrSurfaceFlags, textureSize, |
| 139 NUM_PLOTS_X, NUM_PLOTS_Y, false)); | 139 NUM_PLOTS_X, NUM_PLOTS_Y, false)); |
| 140 if (NULL == fAtlas) { | 140 if (NULL == fAtlas) { |
| 141 return NULL; | 141 return NULL; |
| 142 } | 142 } |
| 143 } | 143 } |
| 144 | 144 |
| 145 const SkRect& bounds = path.getBounds(); | 145 const SkRect& bounds = path.getBounds(); |
| 146 | 146 |
| 147 // generate bounding rect for bitmap draw | 147 // generate bounding rect for bitmap draw |
| 148 SkRect scaledBounds = bounds; | 148 SkRect scaledBounds = bounds; |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 | 348 |
| 349 | 349 |
| 350 vm.mapRect(&r); | 350 vm.mapRect(&r); |
| 351 target->drawIndexedInstances(kTriangles_GrPrimitiveType, 1, 4, 6, &r); | 351 target->drawIndexedInstances(kTriangles_GrPrimitiveType, 1, 4, 6, &r); |
| 352 target->resetVertexSource(); | 352 target->resetVertexSource(); |
| 353 target->resetIndexSource(); | 353 target->resetIndexSource(); |
| 354 | 354 |
| 355 return true; | 355 return true; |
| 356 } | 356 } |
| 357 | 357 |
| OLD | NEW |