Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1060)

Side by Side Diff: src/gpu/GrAtlasTextContext.cpp

Issue 1514933002: Create GrTextUtils (Closed) Base URL: https://skia.googlesource.com/skia.git@cleanuptext9
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/GrAtlasTextBlob.cpp ('k') | src/gpu/GrTextContext.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/gpu/GrAtlasTextBlob.cpp ('k') | src/gpu/GrTextContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698