aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2015-05-13 12:15:06 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-05-13 12:15:06 -0700
commitfc0725645cee5dabc8d282da4c1fab7335152e15 (patch)
tree20015603508df6c20c73a937f4e08e534948ce73
parentd0a1088bf747a9291a178cb08e162d2c84a9aa7c (diff)
fix for blur large glyphs problems
-rw-r--r--src/gpu/GrAtlasTextContext.cpp17
-rw-r--r--src/gpu/SkGpuDevice.cpp6
2 files changed, 17 insertions, 6 deletions
diff --git a/src/gpu/GrAtlasTextContext.cpp b/src/gpu/GrAtlasTextContext.cpp
index 58244e78c2..22436f7c12 100644
--- a/src/gpu/GrAtlasTextContext.cpp
+++ b/src/gpu/GrAtlasTextContext.cpp
@@ -2147,13 +2147,24 @@ inline void GrAtlasTextContext::flushBigGlyphs(BitmapTextBlob* cacheBlob, GrRend
const SkPaint& skPaint,
SkScalar transX, SkScalar transY,
const SkIRect& clipBounds) {
+ if (!cacheBlob->fBigGlyphs.count()) {
+ return;
+ }
+
+ SkMatrix pathMatrix;
+ if (!cacheBlob->fViewMatrix.invert(&pathMatrix)) {
+ SkDebugf("could not invert viewmatrix\n");
+ return;
+ }
+
for (int i = 0; i < cacheBlob->fBigGlyphs.count(); i++) {
BitmapTextBlob::BigGlyph& bigGlyph = cacheBlob->fBigGlyphs[i];
bigGlyph.fVx += transX;
bigGlyph.fVy += transY;
- SkMatrix translate;
- translate.setTranslate(bigGlyph.fVx, bigGlyph.fVy);
- fGpuDevice->internalDrawPath(bigGlyph.fPath, skPaint, SkMatrix::I(), &translate, clipBounds,
+ SkMatrix translate = cacheBlob->fViewMatrix;
+ translate.postTranslate(bigGlyph.fVx, bigGlyph.fVy);
+
+ fGpuDevice->internalDrawPath(bigGlyph.fPath, skPaint, translate, &pathMatrix, clipBounds,
false);
}
}
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 7a50e0409c..7b363635e2 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -785,9 +785,9 @@ void SkGpuDevice::internalDrawPath(const SkPath& origSrcPath, const SkPaint& pai
SkMatrix viewMatrix = origViewMatrix;
if (prePathMatrix) {
- // stroking and path effects are supposed to be applied *after* the prePathMatrix.
- // The pre-path-matrix also should not affect shadeing.
- if (NULL == pathEffect && NULL == paint.getShader() &&
+ // stroking, path effects, and blurs are supposed to be applied *after* the prePathMatrix.
+ // The pre-path-matrix also should not affect shading.
+ if (NULL == paint.getMaskFilter() && NULL == pathEffect && NULL == paint.getShader() &&
(strokeInfo.getStrokeRec().isFillStyle() ||
strokeInfo.getStrokeRec().isHairlineStyle())) {
viewMatrix.preConcat(*prePathMatrix);