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

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

Issue 1352813003: add a ClassID function to GrBatch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 years, 3 months 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
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 "GrBatchFontCache.h" 9 #include "GrBatchFontCache.h"
10 #include "GrBatchFlushState.h" 10 #include "GrBatchFlushState.h"
(...skipping 1425 matching lines...) Expand 10 before | Expand all | Expand 10 after
1436 typedef Blob::Run Run; 1436 typedef Blob::Run Run;
1437 typedef Run::SubRunInfo TextInfo; 1437 typedef Run::SubRunInfo TextInfo;
1438 struct Geometry { 1438 struct Geometry {
1439 Blob* fBlob; 1439 Blob* fBlob;
1440 int fRun; 1440 int fRun;
1441 int fSubRun; 1441 int fSubRun;
1442 GrColor fColor; 1442 GrColor fColor;
1443 SkScalar fTransX; 1443 SkScalar fTransX;
1444 SkScalar fTransY; 1444 SkScalar fTransY;
1445 }; 1445 };
1446 1446
robertphillips 2015/09/17 14:56:06 Can this be first ? Everywhere else too ?
1447 BATCH_CLASS_ID
1448
1447 static TextBatch* CreateBitmap(GrMaskFormat maskFormat, int glyphCount, 1449 static TextBatch* CreateBitmap(GrMaskFormat maskFormat, int glyphCount,
1448 GrBatchFontCache* fontCache) { 1450 GrBatchFontCache* fontCache) {
1449 TextBatch* batch = new TextBatch; 1451 TextBatch* batch = new TextBatch;
1450 1452
1451 batch->initClassID<TextBatch>(); 1453 batch->initClassID<TextBatch>();
1452 batch->fFontCache = fontCache; 1454 batch->fFontCache = fontCache;
1453 switch (maskFormat) { 1455 switch (maskFormat) {
1454 case kA8_GrMaskFormat: 1456 case kA8_GrMaskFormat:
1455 batch->fMaskType = kGrayscaleCoverageMask_MaskType; 1457 batch->fMaskType = kGrayscaleCoverageMask_MaskType;
1456 break; 1458 break;
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after
2279 gTextContext->createDrawTextBlob(rt, clip, grPaint, skPaint, viewMat rix, text, 2281 gTextContext->createDrawTextBlob(rt, clip, grPaint, skPaint, viewMat rix, text,
2280 static_cast<size_t>(textLen), 0, 0, noClip)); 2282 static_cast<size_t>(textLen), 0, 0, noClip));
2281 2283
2282 SkScalar transX = static_cast<SkScalar>(random->nextU()); 2284 SkScalar transX = static_cast<SkScalar>(random->nextU());
2283 SkScalar transY = static_cast<SkScalar>(random->nextU()); 2285 SkScalar transY = static_cast<SkScalar>(random->nextU());
2284 const GrAtlasTextBlob::Run::SubRunInfo& info = blob->fRuns[0].fSubRunInfo[0] ; 2286 const GrAtlasTextBlob::Run::SubRunInfo& info = blob->fRuns[0].fSubRunInfo[0] ;
2285 return gTextContext->createBatch(blob, info, textLen, 0, 0, color, transX, t ransY, skPaint); 2287 return gTextContext->createBatch(blob, info, textLen, 0, 0, color, transX, t ransY, skPaint);
2286 } 2288 }
2287 2289
2288 #endif 2290 #endif
OLDNEW
« no previous file with comments | « gm/convexpolyeffect.cpp ('k') | src/gpu/GrOvalRenderer.cpp » ('j') | src/gpu/batches/GrBatch.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698