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

Unified Diff: src/gpu/GrDistanceFieldTextContext.cpp

Issue 1082913006: Real fix for the Mali bug. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 8 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 | « no previous file | src/gpu/effects/GrDistanceFieldGeoProc.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDistanceFieldTextContext.cpp
diff --git a/src/gpu/GrDistanceFieldTextContext.cpp b/src/gpu/GrDistanceFieldTextContext.cpp
index b1120e46375d1e7ad271cb3a18b486926c0b9e8b..cc592833c9b787bab2eb4aecfa9b43ccbc00ba0b 100755
--- a/src/gpu/GrDistanceFieldTextContext.cpp
+++ b/src/gpu/GrDistanceFieldTextContext.cpp
@@ -271,12 +271,6 @@ inline void GrDistanceFieldTextContext::init(GrRenderTarget* rt, const GrClip& c
fSkPaint.setAutohinted(false);
fSkPaint.setHinting(SkPaint::kNormal_Hinting);
fSkPaint.setSubpixelText(true);
-
- // fix for skia:3528
- // if we're scaling up, include any scaling to match text size in the view matrix
- if (fTextRatio > 1.0f) {
- fViewMatrix.preScale(fTextRatio, fTextRatio);
- }
}
void GrDistanceFieldTextContext::onDrawText(GrRenderTarget* rt, const GrClip& clip,
@@ -490,21 +484,11 @@ void GrDistanceFieldTextContext::setupCoverageEffect(const SkColor& filteredColo
bool useBGR = SkPixelGeometryIsBGR(fDeviceProperties.pixelGeometry());
flags |= fUseLCDText && useBGR ? kBGR_DistanceFieldEffectFlag : 0;
- // fix for skia:3528
- // set the local matrix to correct any text size scaling for gradients et al.
- SkMatrix localMatrix;
- if (fTextRatio > 1.0f) {
- localMatrix.setScale(fTextRatio, fTextRatio);
- } else {
- localMatrix.reset();
- }
-
// see if we need to create a new effect
if (textureUniqueID != fEffectTextureUniqueID ||
filteredColor != fEffectColor ||
flags != fEffectFlags ||
- !fCachedGeometryProcessor->viewMatrix().cheapEqualTo(fViewMatrix) ||
- !fCachedGeometryProcessor->localMatrix().cheapEqualTo(localMatrix)) {
+ !fCachedGeometryProcessor->viewMatrix().cheapEqualTo(fViewMatrix)) {
GrColor color = fPaint.getColor();
if (fUseLCDText) {
@@ -522,7 +506,6 @@ void GrDistanceFieldTextContext::setupCoverageEffect(const SkColor& filteredColo
blueCorrection);
fCachedGeometryProcessor.reset(GrDistanceFieldLCDTextGeoProc::Create(color,
fViewMatrix,
- localMatrix,
fCurrTexture,
params,
widthAdjust,
@@ -536,7 +519,6 @@ void GrDistanceFieldTextContext::setupCoverageEffect(const SkColor& filteredColo
float correction = fDistanceAdjustTable[lum >> kDistanceAdjustLumShift];
fCachedGeometryProcessor.reset(GrDistanceFieldA8TextGeoProc::Create(color,
fViewMatrix,
- localMatrix,
fCurrTexture,
params,
correction,
@@ -545,7 +527,6 @@ void GrDistanceFieldTextContext::setupCoverageEffect(const SkColor& filteredColo
#else
fCachedGeometryProcessor.reset(GrDistanceFieldA8TextGeoProc::Create(color,
fViewMatrix,
- localMatrix,
fCurrTexture,
params,
flags,
@@ -624,16 +605,10 @@ bool GrDistanceFieldTextContext::appendGlyph(GrGlyph::PackedID packed,
SkScalar height = SkIntToScalar(glyph->fBounds.height() - 2*SK_DistanceFieldInset);
SkScalar scale = fTextRatio;
- // if we're scaling up, using fix for skia:3528
- if (scale > 1.0f) {
- sx /= scale;
- sy /= scale;
- } else {
- dx *= scale;
- dy *= scale;
- width *= scale;
- height *= scale;
- }
+ dx *= scale;
+ dy *= scale;
+ width *= scale;
+ height *= scale;
sx += dx;
sy += dy;
SkRect glyphRect = SkRect::MakeXYWH(sx, sy, width, height);
« no previous file with comments | « no previous file | src/gpu/effects/GrDistanceFieldGeoProc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698