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

Unified Diff: src/gpu/GrAtlasTextContext.cpp

Issue 1031423002: Add mixedtextblob gm and a simple bench (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: mac warnings Created 5 years, 9 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/GrAtlasTextContext.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAtlasTextContext.cpp
diff --git a/src/gpu/GrAtlasTextContext.cpp b/src/gpu/GrAtlasTextContext.cpp
index f1af012936b89974dc3a29b680a4ba09bf444a7c..b2de1cf1548426a88c2f1794cfa627cde3deeed9 100644
--- a/src/gpu/GrAtlasTextContext.cpp
+++ b/src/gpu/GrAtlasTextContext.cpp
@@ -368,6 +368,7 @@ void GrAtlasTextContext::internalDrawText(BitmapTextBlob* blob, int runIndex,
GrGlyph::kCoverage_MaskStyle),
Sk48Dot16FloorToInt(fx),
Sk48Dot16FloorToInt(fy),
+ skPaint.getColor(),
fontScaler,
clipRect);
}
@@ -459,6 +460,7 @@ void GrAtlasTextContext::internalDrawPosText(BitmapTextBlob* blob, int runIndex,
GrGlyph::kCoverage_MaskStyle),
Sk48Dot16FloorToInt(fx),
Sk48Dot16FloorToInt(fy),
+ skPaint.getColor(),
fontScaler,
clipRect);
}
@@ -496,6 +498,7 @@ void GrAtlasTextContext::internalDrawPosText(BitmapTextBlob* blob, int runIndex,
GrGlyph::kCoverage_MaskStyle),
Sk48Dot16FloorToInt(fx),
Sk48Dot16FloorToInt(fy),
+ skPaint.getColor(),
fontScaler,
clipRect);
}
@@ -523,6 +526,7 @@ void GrAtlasTextContext::internalDrawPosText(BitmapTextBlob* blob, int runIndex,
GrGlyph::kCoverage_MaskStyle),
Sk48Dot16FloorToInt(fx),
Sk48Dot16FloorToInt(fy),
+ skPaint.getColor(),
fontScaler,
clipRect);
}
@@ -550,6 +554,7 @@ void GrAtlasTextContext::internalDrawPosText(BitmapTextBlob* blob, int runIndex,
GrGlyph::kCoverage_MaskStyle),
Sk48Dot16FloorToInt(fx),
Sk48Dot16FloorToInt(fy),
+ skPaint.getColor(),
fontScaler,
clipRect);
}
@@ -560,7 +565,7 @@ void GrAtlasTextContext::internalDrawPosText(BitmapTextBlob* blob, int runIndex,
}
void GrAtlasTextContext::appendGlyph(BitmapTextBlob* blob, int runIndex, GrGlyph::PackedID packed,
- int vx, int vy, GrFontScaler* scaler,
+ int vx, int vy, GrColor color, GrFontScaler* scaler,
const SkIRect& clipRect) {
if (NULL == fCurrStrike) {
fCurrStrike = fContext->getBatchFontCache()->getStrike(scaler);
@@ -628,7 +633,6 @@ void GrAtlasTextContext::appendGlyph(BitmapTextBlob* blob, int runIndex, GrGlyph
r.fBottom = r.fTop + SkIntToScalar(height);
run.fVertexBounds.joinNonEmptyArg(r);
- GrColor color = fPaint.getColor();
run.fColor = color;
intptr_t vertex = reinterpret_cast<intptr_t>(blob->fVertices + subRun->fVertexEndIndex);
@@ -745,6 +749,7 @@ public:
}
GrTextureParams params(SkShader::kClamp_TileMode, GrTextureParams::kNone_FilterMode);
+
// This will be ignored in the non A8 case
bool opaqueVertexColors = GrColorIsOpaque(this->color());
SkAutoTUnref<const GrGeometryProcessor> gp(
@@ -1026,16 +1031,17 @@ void GrAtlasTextContext::flush(GrDrawTarget* target, BitmapTextBlob* blob, GrRen
}
GrMaskFormat format = info.fMaskFormat;
- if (kARGB_GrMaskFormat == format) {
- color = SkColorSetARGB(paintAlpha, paintAlpha, paintAlpha, paintAlpha);
- }
+ GrColor subRunColor = kARGB_GrMaskFormat == format ?
+ SkColorSetARGB(paintAlpha, paintAlpha, paintAlpha, paintAlpha) :
+ color;
BitmapTextBatch::Geometry geometry;
geometry.fBlob.reset(SkRef(blob));
geometry.fRun = run;
geometry.fSubRun = subRun;
geometry.fColor = color;
- SkAutoTUnref<GrBatch> batch(BitmapTextBatch::Create(geometry, color, format, glyphCount,
+ SkAutoTUnref<GrBatch> batch(BitmapTextBatch::Create(geometry, subRunColor, format,
+ glyphCount,
fContext->getBatchFontCache()));
target->drawBatch(&pipelineBuilder, batch, &blob->fRuns[run].fVertexBounds);
« no previous file with comments | « src/gpu/GrAtlasTextContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698