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

Unified Diff: src/gpu/text/GrAtlasTextContext.cpp

Issue 1606943002: A few more small changes to make GrAtlasTextBlob nearly self contained (Closed) Base URL: https://skia.googlesource.com/skia.git@cleanuptext16
Patch Set: cleanup Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/text/GrAtlasTextContext.h ('k') | src/gpu/text/GrTextUtils.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/text/GrAtlasTextContext.cpp
diff --git a/src/gpu/text/GrAtlasTextContext.cpp b/src/gpu/text/GrAtlasTextContext.cpp
index 8107f081ca0415e87bebc907be5c3887206f648a..9537c82dccd59c97d43b62f7e22a37c1dbc0a127 100644
--- a/src/gpu/text/GrAtlasTextContext.cpp
+++ b/src/gpu/text/GrAtlasTextContext.cpp
@@ -191,13 +191,7 @@ void GrAtlasTextContext::regenerateTextBlob(GrAtlasTextBlob* cacheBlob,
const SkMatrix& viewMatrix,
const SkTextBlob* blob, SkScalar x, SkScalar y,
SkDrawFilter* drawFilter) {
- // The color here is the GrPaint color, and it is used to determine whether we
- // have to regenerate LCD text blobs.
- // We use this color vs the SkPaint color because it has the colorfilter applied.
- cacheBlob->fPaintColor = color;
- cacheBlob->fViewMatrix = viewMatrix;
- cacheBlob->fX = x;
- cacheBlob->fY = y;
+ cacheBlob->initReusableBlob(color, viewMatrix, x, y);
// Regenerate textblob
SkPaint runPaint = skPaint;
@@ -248,7 +242,7 @@ void GrAtlasTextContext::regenerateTextBlob(GrAtlasTextBlob* cacheBlob,
}
}
} else if (SkDraw::ShouldDrawTextAsPaths(runPaint, viewMatrix)) {
- cacheBlob->fRuns[run].fDrawAsPaths = true;
+ cacheBlob->setRunDrawAsPaths(run);
} else {
switch (it.positioning()) {
case SkTextBlob::kDefault_Positioning:
@@ -287,7 +281,7 @@ GrAtlasTextContext::createDrawTextBlob(const GrPaint& paint, const SkPaint& skPa
int glyphCount = skPaint.countText(text, byteLength);
GrAtlasTextBlob* blob = fCache->createBlob(glyphCount, 1, GrAtlasTextBlob::kGrayTextVASize);
- blob->fViewMatrix = viewMatrix;
+ blob->initThrowawayBlob(viewMatrix);
if (GrTextUtils::CanDrawAsDistanceFields(skPaint, viewMatrix, fSurfaceProps,
*fContext->caps()->shaderCaps())) {
@@ -310,7 +304,7 @@ GrAtlasTextContext::createDrawPosTextBlob(const GrPaint& paint, const SkPaint& s
int glyphCount = skPaint.countText(text, byteLength);
GrAtlasTextBlob* blob = fCache->createBlob(glyphCount, 1, GrAtlasTextBlob::kGrayTextVASize);
- blob->fViewMatrix = viewMatrix;
+ blob->initThrowawayBlob(viewMatrix);
if (GrTextUtils::CanDrawAsDistanceFields(skPaint, viewMatrix, fSurfaceProps,
*fContext->caps()->shaderCaps())) {
@@ -401,10 +395,9 @@ DRAW_BATCH_TEST_DEFINE(TextBlobBatch) {
SkScalar transX = static_cast<SkScalar>(random->nextU());
SkScalar transY = static_cast<SkScalar>(random->nextU());
- const GrAtlasTextBlob::Run::SubRunInfo& info = blob->fRuns[0].fSubRunInfo[0];
- return blob->createBatch(info, textLen, 0, 0, color, transX, transY, skPaint,
- gSurfaceProps, gTextContext->dfAdjustTable(),
- context->getBatchFontCache());
+ return blob->test_createBatch(textLen, 0, 0, color, transX, transY, skPaint,
+ gSurfaceProps, gTextContext->dfAdjustTable(),
+ context->getBatchFontCache());
}
#endif
« no previous file with comments | « src/gpu/text/GrAtlasTextContext.h ('k') | src/gpu/text/GrTextUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698