| 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 "GrDrawContext.h" | 9 #include "GrDrawContext.h" |
| 10 #include "GrDrawTarget.h" | 10 #include "GrDrawTarget.h" |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 if (canCache) { | 196 if (canCache) { |
| 197 cacheBlob.reset(SkRef(fCache->createCachedBlob(blob, key, blurRec, s
kPaint, | 197 cacheBlob.reset(SkRef(fCache->createCachedBlob(blob, key, blurRec, s
kPaint, |
| 198 GrAtlasTextBlob::kGra
yTextVASize))); | 198 GrAtlasTextBlob::kGra
yTextVASize))); |
| 199 } else { | 199 } else { |
| 200 cacheBlob.reset(fCache->createBlob(blob, GrAtlasTextBlob::kGrayTextV
ASize)); | 200 cacheBlob.reset(fCache->createBlob(blob, GrAtlasTextBlob::kGrayTextV
ASize)); |
| 201 } | 201 } |
| 202 this->regenerateTextBlob(cacheBlob, skPaint, grPaint.getColor(), viewMat
rix, | 202 this->regenerateTextBlob(cacheBlob, skPaint, grPaint.getColor(), viewMat
rix, |
| 203 blob, x, y, drawFilter, clip); | 203 blob, x, y, drawFilter, clip); |
| 204 } | 204 } |
| 205 | 205 |
| 206 cacheBlob->flushCached(blob, fContext, dc, this, fSurfaceProps, fDistanceAdj
ustTable, skPaint, | 206 cacheBlob->flushCached(fContext, dc, blob, fSurfaceProps, fDistanceAdjustTab
le, skPaint, |
| 207 grPaint, drawFilter, clip, viewMatrix, clipBounds, x,
y, transX, transY); | 207 grPaint, drawFilter, clip, viewMatrix, clipBounds, x,
y, transX, transY); |
| 208 } | 208 } |
| 209 | 209 |
| 210 inline bool GrAtlasTextContext::canDrawAsDistanceFields(const SkPaint& skPaint, | 210 inline bool GrAtlasTextContext::canDrawAsDistanceFields(const SkPaint& skPaint, |
| 211 const SkMatrix& viewMatr
ix) { | 211 const SkMatrix& viewMatr
ix) { |
| 212 // TODO: support perspective (need getMaxScale replacement) | 212 // TODO: support perspective (need getMaxScale replacement) |
| 213 if (viewMatrix.hasPerspective()) { | 213 if (viewMatrix.hasPerspective()) { |
| 214 return false; | 214 return false; |
| 215 } | 215 } |
| 216 | 216 |
| (...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 907 | 907 |
| 908 SkScalar transX = static_cast<SkScalar>(random->nextU()); | 908 SkScalar transX = static_cast<SkScalar>(random->nextU()); |
| 909 SkScalar transY = static_cast<SkScalar>(random->nextU()); | 909 SkScalar transY = static_cast<SkScalar>(random->nextU()); |
| 910 const GrAtlasTextBlob::Run::SubRunInfo& info = blob->fRuns[0].fSubRunInfo[0]
; | 910 const GrAtlasTextBlob::Run::SubRunInfo& info = blob->fRuns[0].fSubRunInfo[0]
; |
| 911 return blob->createBatch(info, textLen, 0, 0, color, transX, transY, skPaint
, | 911 return blob->createBatch(info, textLen, 0, 0, color, transX, transY, skPaint
, |
| 912 gSurfaceProps, gTextContext->dfAdjustTable(), | 912 gSurfaceProps, gTextContext->dfAdjustTable(), |
| 913 context->getBatchFontCache()); | 913 context->getBatchFontCache()); |
| 914 } | 914 } |
| 915 | 915 |
| 916 #endif | 916 #endif |
| OLD | NEW |