| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 #include "GrAtlasTextContext.h" | 7 #include "GrAtlasTextContext.h" |
| 8 | 8 |
| 9 #include "GrAtlas.h" | 9 #include "GrAtlas.h" |
| 10 #include "GrBatch.h" | 10 #include "GrBatch.h" |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 | 240 |
| 241 SkIRect clipRect; | 241 SkIRect clipRect; |
| 242 clip.getConservativeBounds(rt->width(), rt->height(), &clipRect); | 242 clip.getConservativeBounds(rt->width(), rt->height(), &clipRect); |
| 243 | 243 |
| 244 SkScalar transX = 0.f; | 244 SkScalar transX = 0.f; |
| 245 SkScalar transY = 0.f; | 245 SkScalar transY = 0.f; |
| 246 | 246 |
| 247 // Though for the time being runs in the textblob can override the paint, th
ey only touch font | 247 // Though for the time being runs in the textblob can override the paint, th
ey only touch font |
| 248 // info. | 248 // info. |
| 249 GrPaint grPaint; | 249 GrPaint grPaint; |
| 250 SkPaint2GrPaintShader(fContext, rt, skPaint, viewMatrix, true, &grPaint); | 250 if (!SkPaint2GrPaint(fContext, rt, skPaint, viewMatrix, true, &grPaint)) { |
| 251 return; |
| 252 } |
| 251 | 253 |
| 252 if (cacheBlob) { | 254 if (cacheBlob) { |
| 253 if (MustRegenerateBlob(&transX, &transY, *cacheBlob, skPaint, blurRec, v
iewMatrix, x, y)) { | 255 if (MustRegenerateBlob(&transX, &transY, *cacheBlob, skPaint, blurRec, v
iewMatrix, x, y)) { |
| 254 // We have to remake the blob because changes may invalidate our mas
ks. | 256 // We have to remake the blob because changes may invalidate our mas
ks. |
| 255 // TODO we could probably get away reuse most of the time if the poi
nter is unique, | 257 // TODO we could probably get away reuse most of the time if the poi
nter is unique, |
| 256 // but we'd have to clear the subrun information | 258 // but we'd have to clear the subrun information |
| 257 fCache->remove(cacheBlob); | 259 fCache->remove(cacheBlob); |
| 258 cacheBlob.reset(SkRef(fCache->createCachedBlob(blob, key, blurRec, s
kPaint, | 260 cacheBlob.reset(SkRef(fCache->createCachedBlob(blob, key, blurRec, s
kPaint, |
| 259 kGrayTextVASize))); | 261 kGrayTextVASize))); |
| 260 this->regenerateTextBlob(cacheBlob, skPaint, grPaint.getColor(), vie
wMatrix, blob, x, y, | 262 this->regenerateTextBlob(cacheBlob, skPaint, grPaint.getColor(), vie
wMatrix, blob, x, y, |
| (...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1310 | 1312 |
| 1311 GrColor color = grPaint.getColor(); | 1313 GrColor color = grPaint.getColor(); |
| 1312 uint8_t paintAlpha = skPaint.getAlpha(); | 1314 uint8_t paintAlpha = skPaint.getAlpha(); |
| 1313 for (int run = 0; run < cacheBlob->fRunCount; run++) { | 1315 for (int run = 0; run < cacheBlob->fRunCount; run++) { |
| 1314 this->flushRun(target, &pipelineBuilder, cacheBlob, run, color, paintAlp
ha, 0, 0); | 1316 this->flushRun(target, &pipelineBuilder, cacheBlob, run, color, paintAlp
ha, 0, 0); |
| 1315 } | 1317 } |
| 1316 | 1318 |
| 1317 // Now flush big glyphs | 1319 // Now flush big glyphs |
| 1318 this->flushBigGlyphs(cacheBlob, rt, grPaint, clip, 0, 0); | 1320 this->flushBigGlyphs(cacheBlob, rt, grPaint, clip, 0, 0); |
| 1319 } | 1321 } |
| OLD | NEW |