aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrAtlasTextContext.cpp
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2015-05-11 13:04:28 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-05-11 13:04:28 -0700
commite4cee1f283c435618343f0c7b298207d5a9a3e1c (patch)
treef8e161fa7b6791deddb627f011ba2af2ba16c8fc /src/gpu/GrAtlasTextContext.cpp
parent0e9ac4a28b8fbfcaea1f83c4bd5fe5a9a1aecac3 (diff)
fix for cached textblobs look garbled
Diffstat (limited to 'src/gpu/GrAtlasTextContext.cpp')
-rw-r--r--src/gpu/GrAtlasTextContext.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gpu/GrAtlasTextContext.cpp b/src/gpu/GrAtlasTextContext.cpp
index c908137477..227ba1f65e 100644
--- a/src/gpu/GrAtlasTextContext.cpp
+++ b/src/gpu/GrAtlasTextContext.cpp
@@ -366,12 +366,18 @@ void GrAtlasTextContext::drawTextBlob(GrRenderTarget* rt, const GrClip& clip,
if (canCache) {
bool hasLCD = HasLCD(blob);
+
+ // We canonicalize all non-lcd draws to use kUnknown_SkPixelGeometry
+ SkPixelGeometry pixelGeometry = hasLCD ? fDeviceProperties.pixelGeometry() :
+ kUnknown_SkPixelGeometry;
+
// TODO we want to figure out a way to be able to use the canonical color on LCD text,
// see the note on ComputeCanonicalColor above. We pick a dummy value for LCD text to
// ensure we always match the same key
GrColor canonicalColor = hasLCD ? SK_ColorTRANSPARENT :
ComputeCanonicalColor(skPaint, hasLCD);
+ key.fPixelGeometry = pixelGeometry;
key.fUniqueID = blob->uniqueID();
key.fStyle = skPaint.getStyle();
key.fHasBlur = SkToBool(mf);