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

Side by Side Diff: src/gpu/batches/GrAtlasTextBatch.cpp

Issue 1776383002: Use correct gradient calculation for rotated distance fields. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix android error Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 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 "GrAtlasTextBatch.h" 8 #include "GrAtlasTextBatch.h"
9 9
10 #include "GrBatchFlushState.h" 10 #include "GrBatchFlushState.h"
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 254
255 // TODO just use class params 255 // TODO just use class params
256 // TODO trying to figure out why lcd is so whack 256 // TODO trying to figure out why lcd is so whack
257 GrGeometryProcessor* GrAtlasTextBatch::setupDfProcessor(const SkMatrix& viewMatr ix, 257 GrGeometryProcessor* GrAtlasTextBatch::setupDfProcessor(const SkMatrix& viewMatr ix,
258 SkColor filteredColor, 258 SkColor filteredColor,
259 GrColor color, GrTexture * texture) const { 259 GrColor color, GrTexture * texture) const {
260 GrTextureParams params(SkShader::kClamp_TileMode, GrTextureParams::kBilerp_F ilterMode); 260 GrTextureParams params(SkShader::kClamp_TileMode, GrTextureParams::kBilerp_F ilterMode);
261 bool isLCD = this->isLCD(); 261 bool isLCD = this->isLCD();
262 // set up any flags 262 // set up any flags
263 uint32_t flags = viewMatrix.isSimilarity() ? kSimilarity_DistanceFieldEffect Flag : 0; 263 uint32_t flags = viewMatrix.isSimilarity() ? kSimilarity_DistanceFieldEffect Flag : 0;
264 flags |= viewMatrix.isScaleTranslate() ? kScaleOnly_DistanceFieldEffectFlag : 0;
264 265
265 // see if we need to create a new effect 266 // see if we need to create a new effect
266 if (isLCD) { 267 if (isLCD) {
267 flags |= kUseLCD_DistanceFieldEffectFlag; 268 flags |= kUseLCD_DistanceFieldEffectFlag;
268 flags |= viewMatrix.rectStaysRect() ? kRectToRect_DistanceFieldEffectFla g : 0;
269 flags |= fUseBGR ? kBGR_DistanceFieldEffectFlag : 0; 269 flags |= fUseBGR ? kBGR_DistanceFieldEffectFlag : 0;
270 270
271 GrColor colorNoPreMul = skcolor_to_grcolor_nopremultiply(filteredColor); 271 GrColor colorNoPreMul = skcolor_to_grcolor_nopremultiply(filteredColor);
272 272
273 float redCorrection = 273 float redCorrection =
274 (*fDistanceAdjustTable)[GrColorUnpackR(colorNoPreMul) >> kDistanceAd justLumShift]; 274 (*fDistanceAdjustTable)[GrColorUnpackR(colorNoPreMul) >> kDistanceAd justLumShift];
275 float greenCorrection = 275 float greenCorrection =
276 (*fDistanceAdjustTable)[GrColorUnpackG(colorNoPreMul) >> kDistanceAd justLumShift]; 276 (*fDistanceAdjustTable)[GrColorUnpackG(colorNoPreMul) >> kDistanceAd justLumShift];
277 float blueCorrection = 277 float blueCorrection =
278 (*fDistanceAdjustTable)[GrColorUnpackB(colorNoPreMul) >> kDistanceAd justLumShift]; 278 (*fDistanceAdjustTable)[GrColorUnpackB(colorNoPreMul) >> kDistanceAd justLumShift];
(...skipping 29 matching lines...) Expand all
308 this->usesLocalCoords()); 308 this->usesLocalCoords());
309 #endif 309 #endif
310 } 310 }
311 311
312 } 312 }
313 313
314 void GrBlobRegenHelper::flush() { 314 void GrBlobRegenHelper::flush() {
315 fBatch->flush(fTarget, fFlushInfo); 315 fBatch->flush(fTarget, fFlushInfo);
316 fTarget->initDraw(fGP, fBatch->pipeline()); 316 fTarget->initDraw(fGP, fBatch->pipeline());
317 } 317 }
OLDNEW
« no previous file with comments | « src/gpu/batches/GrAADistanceFieldPathRenderer.cpp ('k') | src/gpu/effects/GrDistanceFieldGeoProc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698