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

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

Issue 740343006: Ignore SkGlyphCache gamma for nvpr text (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Reabse Created 6 years 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 | « no previous file | no next file » | 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 2014 Google Inc. 2 * Copyright 2014 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 "GrStencilAndCoverTextContext.h" 8 #include "GrStencilAndCoverTextContext.h"
9 #include "GrBitmapTextContext.h" 9 #include "GrBitmapTextContext.h"
10 #include "GrDrawTarget.h" 10 #include "GrDrawTarget.h"
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 SkMatrix m; 253 SkMatrix m;
254 m.setScale(1, -1); 254 m.setScale(1, -1);
255 fContext->setMatrix(m); 255 fContext->setMatrix(m);
256 256
257 // Post-flip the initial matrix so we're left with just the flip after 257 // Post-flip the initial matrix so we're left with just the flip after
258 // the paint preConcats the inverse. 258 // the paint preConcats the inverse.
259 m = fContextInitialMatrix; 259 m = fContextInitialMatrix;
260 m.postScale(1, -1); 260 m.postScale(1, -1);
261 fPaint.localCoordChangeInverse(m); 261 fPaint.localCoordChangeInverse(m);
262 262
263 fGlyphCache = fSkPaint.detachCache(&fDeviceProperties, &fContextInitialM atrix, false); 263 fGlyphCache = fSkPaint.detachCache(&fDeviceProperties, &fContextInitialM atrix,
264 true /*ignoreGamma*/);
264 fGlyphs = get_gr_glyphs(fContext, fGlyphCache->getScalerContext()->getTy peface(), 265 fGlyphs = get_gr_glyphs(fContext, fGlyphCache->getScalerContext()->getTy peface(),
265 &fGlyphCache->getDescriptor(), fStroke); 266 &fGlyphCache->getDescriptor(), fStroke);
266 } else { 267 } else {
267 // Don't bake strokes into the glyph outlines. We will stroke the glyphs 268 // Don't bake strokes into the glyph outlines. We will stroke the glyphs
268 // using the GPU instead. This is the fast path. 269 // using the GPU instead. This is the fast path.
269 fStroke = SkStrokeRec(fSkPaint); 270 fStroke = SkStrokeRec(fSkPaint);
270 fSkPaint.setStyle(SkPaint::kFill_Style); 271 fSkPaint.setStyle(SkPaint::kFill_Style);
271 272
272 if (fStroke.isHairlineStyle()) { 273 if (fStroke.isHairlineStyle()) {
273 // Approximate hairline stroke. 274 // Approximate hairline stroke.
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 fTextRatio = fTextInverseRatio = 1.0f; 323 fTextRatio = fTextInverseRatio = 1.0f;
323 canUseRawPaths = false; 324 canUseRawPaths = false;
324 } 325 }
325 326
326 SkMatrix textMatrix; 327 SkMatrix textMatrix;
327 // Glyphs loaded by GPU path rendering have an inverted y-direction. 328 // Glyphs loaded by GPU path rendering have an inverted y-direction.
328 textMatrix.setScale(fTextRatio, -fTextRatio); 329 textMatrix.setScale(fTextRatio, -fTextRatio);
329 fPaint.localCoordChange(textMatrix); 330 fPaint.localCoordChange(textMatrix);
330 fContext->concatMatrix(textMatrix); 331 fContext->concatMatrix(textMatrix);
331 332
332 fGlyphCache = fSkPaint.detachCache(&fDeviceProperties, NULL, false); 333 fGlyphCache = fSkPaint.detachCache(&fDeviceProperties, NULL, true /*igno reGamma*/);
333 fGlyphs = canUseRawPaths ? 334 fGlyphs = canUseRawPaths ?
334 get_gr_glyphs(fContext, fSkPaint.getTypeface(), NULL, fStr oke) : 335 get_gr_glyphs(fContext, fSkPaint.getTypeface(), NULL, fStr oke) :
335 get_gr_glyphs(fContext, fGlyphCache->getScalerContext()->g etTypeface(), 336 get_gr_glyphs(fContext, fGlyphCache->getScalerContext()->g etTypeface(),
336 &fGlyphCache->getDescriptor(), fStroke); 337 &fGlyphCache->getDescriptor(), fStroke);
337 } 338 }
338 339
339 fStateRestore.set(&fDrawState); 340 fStateRestore.set(&fDrawState);
340 341
341 fDrawState.setFromPaint(fPaint, fContext->getMatrix(), fContext->getRenderTa rget()); 342 fDrawState.setFromPaint(fPaint, fContext->getMatrix(), fContext->getRenderTa rget());
342 343
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 445
445 SkGlyphCache::AttachCache(fGlyphCache); 446 SkGlyphCache::AttachCache(fGlyphCache);
446 fGlyphCache = NULL; 447 fGlyphCache = NULL;
447 448
448 fDrawState.stencil()->setDisabled(); 449 fDrawState.stencil()->setDisabled();
449 fStateRestore.set(NULL); 450 fStateRestore.set(NULL);
450 fContext->setMatrix(fContextInitialMatrix); 451 fContext->setMatrix(fContextInitialMatrix);
451 GrTextContext::finish(); 452 GrTextContext::finish();
452 } 453 }
453 454
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698