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 "GrBatchFontCache.h" | 9 #include "GrBatchFontCache.h" |
10 #include "GrBatchFlushState.h" | 10 #include "GrBatchFlushState.h" |
(...skipping 2150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2161 bigGlyph.fVx += transX; | 2161 bigGlyph.fVx += transX; |
2162 bigGlyph.fVy += transY; | 2162 bigGlyph.fVy += transY; |
2163 SkMatrix ctm; | 2163 SkMatrix ctm; |
2164 ctm.setScale(bigGlyph.fScale, bigGlyph.fScale); | 2164 ctm.setScale(bigGlyph.fScale, bigGlyph.fScale); |
2165 ctm.postTranslate(bigGlyph.fVx, bigGlyph.fVy); | 2165 ctm.postTranslate(bigGlyph.fVx, bigGlyph.fVy); |
2166 if (bigGlyph.fApplyVM) { | 2166 if (bigGlyph.fApplyVM) { |
2167 ctm.postConcat(cacheBlob->fViewMatrix); | 2167 ctm.postConcat(cacheBlob->fViewMatrix); |
2168 } | 2168 } |
2169 | 2169 |
2170 GrBlurUtils::drawPathWithMaskFilter(fContext, dc, rt, clip, bigGlyph.fPa
th, | 2170 GrBlurUtils::drawPathWithMaskFilter(fContext, dc, rt, clip, bigGlyph.fPa
th, |
2171 skPaint, ctm, nullptr, clipBounds, f
alse); | 2171 skPaint, ctm, nullptr, clipBounds, f
alse, |
| 2172 GrTextureProvider::kApprox_SizeConst
raint); |
2172 } | 2173 } |
2173 } | 2174 } |
2174 | 2175 |
2175 void GrAtlasTextContext::flush(const SkTextBlob* blob, | 2176 void GrAtlasTextContext::flush(const SkTextBlob* blob, |
2176 GrAtlasTextBlob* cacheBlob, | 2177 GrAtlasTextBlob* cacheBlob, |
2177 GrDrawContext* dc, | 2178 GrDrawContext* dc, |
2178 GrRenderTarget* rt, | 2179 GrRenderTarget* rt, |
2179 const SkPaint& skPaint, | 2180 const SkPaint& skPaint, |
2180 const GrPaint& grPaint, | 2181 const GrPaint& grPaint, |
2181 SkDrawFilter* drawFilter, | 2182 SkDrawFilter* drawFilter, |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2282 gTextContext->createDrawTextBlob(rt, clip, grPaint, skPaint, viewMat
rix, text, | 2283 gTextContext->createDrawTextBlob(rt, clip, grPaint, skPaint, viewMat
rix, text, |
2283 static_cast<size_t>(textLen), 0, 0,
noClip)); | 2284 static_cast<size_t>(textLen), 0, 0,
noClip)); |
2284 | 2285 |
2285 SkScalar transX = static_cast<SkScalar>(random->nextU()); | 2286 SkScalar transX = static_cast<SkScalar>(random->nextU()); |
2286 SkScalar transY = static_cast<SkScalar>(random->nextU()); | 2287 SkScalar transY = static_cast<SkScalar>(random->nextU()); |
2287 const GrAtlasTextBlob::Run::SubRunInfo& info = blob->fRuns[0].fSubRunInfo[0]
; | 2288 const GrAtlasTextBlob::Run::SubRunInfo& info = blob->fRuns[0].fSubRunInfo[0]
; |
2288 return gTextContext->createBatch(blob, info, textLen, 0, 0, color, transX, t
ransY, skPaint); | 2289 return gTextContext->createBatch(blob, info, textLen, 0, 0, color, transX, t
ransY, skPaint); |
2289 } | 2290 } |
2290 | 2291 |
2291 #endif | 2292 #endif |
OLD | NEW |