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

Side by Side Diff: src/gpu/GrDistanceFieldTextContext.cpp

Issue 205343008: Distance field fixes for Android (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix int->float conversion issues Created 6 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 unified diff | Download patch
« no previous file with comments | « src/gpu/GrAtlas.cpp ('k') | src/gpu/GrOvalRenderer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrDistanceFieldTextContext.h" 8 #include "GrDistanceFieldTextContext.h"
9 #include "GrAtlas.h" 9 #include "GrAtlas.h"
10 #include "GrDrawTarget.h" 10 #include "GrDrawTarget.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 GrDrawState::AutoRestoreEffects are(drawState); 74 GrDrawState::AutoRestoreEffects are(drawState);
75 drawState->setFromPaint(fPaint, fContext->getMatrix(), fContext->getRenderTa rget()); 75 drawState->setFromPaint(fPaint, fContext->getMatrix(), fContext->getRenderTa rget());
76 76
77 if (fCurrVertex > 0) { 77 if (fCurrVertex > 0) {
78 // setup our sampler state for our text texture/atlas 78 // setup our sampler state for our text texture/atlas
79 SkASSERT(GrIsALIGN4(fCurrVertex)); 79 SkASSERT(GrIsALIGN4(fCurrVertex));
80 SkASSERT(fCurrTexture); 80 SkASSERT(fCurrTexture);
81 GrTextureParams params(SkShader::kRepeat_TileMode, GrTextureParams::kBil erp_FilterMode); 81 GrTextureParams params(SkShader::kRepeat_TileMode, GrTextureParams::kBil erp_FilterMode);
82 82
83 // This effect could be stored with one of the cache objects (atlas?) 83 // This effect could be stored with one of the cache objects (atlas?)
84 SkISize size = fStrike->getAtlasSize();
85 drawState->addCoverageEffect( 84 drawState->addCoverageEffect(
86 GrDistanceFieldTextureEffect::Create(fCurrTextur e, params, size), 85 GrDistanceFieldTextureEffect::Create(fCurrTexture, para ms,
87 kGlyphCoordsAttributeIndex)->unref(); 86 fContext->getMatri x().isSimilarity()),
87 kGlyphCoordsAttributeIndex)->unref();
88 88
89 if (!GrPixelConfigIsAlphaOnly(fCurrTexture->config())) { 89 if (!GrPixelConfigIsAlphaOnly(fCurrTexture->config())) {
90 if (kOne_GrBlendCoeff != fPaint.getSrcBlendCoeff() || 90 if (kOne_GrBlendCoeff != fPaint.getSrcBlendCoeff() ||
91 kISA_GrBlendCoeff != fPaint.getDstBlendCoeff() || 91 kISA_GrBlendCoeff != fPaint.getDstBlendCoeff() ||
92 fPaint.numColorStages()) { 92 fPaint.numColorStages()) {
93 GrPrintf("LCD Text will not draw correctly.\n"); 93 GrPrintf("LCD Text will not draw correctly.\n");
94 } 94 }
95 // We don't use the GrPaint's color in this case because it's been p remultiplied by 95 // We don't use the GrPaint's color in this case because it's been p remultiplied by
96 // alpha. Instead we feed in a non-premultiplied color, and multiply its alpha by 96 // alpha. Instead we feed in a non-premultiplied color, and multiply its alpha by
97 // the mask texture color. The end result is that we get 97 // the mask texture color. The end result is that we get
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 SkScalarToFixed(y) - (glyph.fAdvanceY >> a lignShift) 449 SkScalarToFixed(y) - (glyph.fAdvanceY >> a lignShift)
450 + SK_FixedHalf, //d1g.fHalfSampleY, 450 + SK_FixedHalf, //d1g.fHalfSampleY,
451 fontScaler); 451 fontScaler);
452 } 452 }
453 pos += scalarsPerPosition; 453 pos += scalarsPerPosition;
454 } 454 }
455 } 455 }
456 456
457 this->finish(); 457 this->finish();
458 } 458 }
OLDNEW
« no previous file with comments | « src/gpu/GrAtlas.cpp ('k') | src/gpu/GrOvalRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698