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

Unified Diff: src/gpu/GrAtlasTextContext.cpp

Issue 1135113002: Fix blur on large glyphs in runs < SkGlyphCache::max (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: a bit more Created 5 years, 7 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 c908137477672544f727e5ab31839a90c6547b1c..6ee8a8e14712675e801f072a82d3f132dac47a22 100644
--- a/src/gpu/GrAtlasTextContext.cpp
+++ b/src/gpu/GrAtlasTextContext.cpp
@@ -772,7 +772,7 @@ void GrAtlasTextContext::onDrawText(GrRenderTarget* rt, const GrClip& clip,
SkAutoTUnref<BitmapTextBlob> blob(
this->createDrawTextBlob(rt, clip, paint, skPaint, viewMatrix,
text, byteLength, x, y, regionClipBounds));
- this->flush(fContext->getTextTarget(), blob, rt, skPaint, paint, clip);
+ this->flush(fContext->getTextTarget(), blob, rt, skPaint, paint, clip, regionClipBounds);
}
void GrAtlasTextContext::onDrawPosText(GrRenderTarget* rt, const GrClip& clip,
@@ -787,7 +787,7 @@ void GrAtlasTextContext::onDrawPosText(GrRenderTarget* rt, const GrClip& clip,
pos, scalarsPerPosition,
offset, regionClipBounds));
- this->flush(fContext->getTextTarget(), blob, rt, skPaint, paint, clip);
+ this->flush(fContext->getTextTarget(), blob, rt, skPaint, paint, clip, regionClipBounds);
}
void GrAtlasTextContext::internalDrawBMPText(BitmapTextBlob* blob, int runIndex,
@@ -2139,8 +2139,9 @@ inline void GrAtlasTextContext::flushRun(GrDrawTarget* target, GrPipelineBuilder
}
inline void GrAtlasTextContext::flushBigGlyphs(BitmapTextBlob* cacheBlob, GrRenderTarget* rt,
- const GrPaint& grPaint, const GrClip& clip,
- SkScalar transX, SkScalar transY) {
+ const SkPaint& skPaint,
+ SkScalar transX, SkScalar transY,
+ const SkIRect& clipBounds) {
for (int i = 0; i < cacheBlob->fBigGlyphs.count(); i++) {
BitmapTextBlob::BigGlyph& bigGlyph = cacheBlob->fBigGlyphs[i];
bigGlyph.fVx += SkScalarTruncToInt(transX);
@@ -2148,10 +2149,9 @@ inline void GrAtlasTextContext::flushBigGlyphs(BitmapTextBlob* cacheBlob, GrRend
SkMatrix translate;
translate.setTranslate(SkIntToScalar(bigGlyph.fVx),
SkIntToScalar(bigGlyph.fVy));
- SkPath tmpPath(bigGlyph.fPath);
- tmpPath.transform(translate);
GrStrokeInfo strokeInfo(SkStrokeRec::kFill_InitStyle);
- fContext->drawPath(rt, clip, grPaint, SkMatrix::I(), tmpPath, strokeInfo);
+ fGpuDevice->internalDrawPath(bigGlyph.fPath, skPaint, SkMatrix::I(), &translate, clipBounds,
+ false);
}
}
@@ -2185,7 +2185,7 @@ void GrAtlasTextContext::flush(GrDrawTarget* target,
}
// Now flush big glyphs
- this->flushBigGlyphs(cacheBlob, rt, grPaint, clip, transX, transY);
+ this->flushBigGlyphs(cacheBlob, rt, skPaint, transX, transY, clipBounds);
}
void GrAtlasTextContext::flush(GrDrawTarget* target,
@@ -2193,7 +2193,8 @@ void GrAtlasTextContext::flush(GrDrawTarget* target,
GrRenderTarget* rt,
const SkPaint& skPaint,
const GrPaint& grPaint,
- const GrClip& clip) {
+ const GrClip& clip,
+ const SkIRect& clipBounds) {
GrPipelineBuilder pipelineBuilder;
pipelineBuilder.setFromPaint(grPaint, rt, clip);
@@ -2203,7 +2204,7 @@ void GrAtlasTextContext::flush(GrDrawTarget* target,
}
// Now flush big glyphs
- this->flushBigGlyphs(cacheBlob, rt, grPaint, clip, 0, 0);
+ this->flushBigGlyphs(cacheBlob, rt, skPaint, 0, 0, clipBounds);
}
///////////////////////////////////////////////////////////////////////////////////////////////////
« 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