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

Side by Side Diff: src/gpu/text/GrTextUtils.cpp

Issue 1813553005: switch patheffects over to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: try to fix xpsdevice 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
« no previous file with comments | « src/effects/SkLayerDrawLooper.cpp ('k') | src/pdf/SkPDFDevice.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 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 "GrTextUtils.h" 8 #include "GrTextUtils.h"
9 9
10 #include "GrAtlasTextBlob.h" 10 #include "GrAtlasTextBlob.h"
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 SkPaint::GlyphCacheProc glyphCacheProc = paint.getGlyphCacheProc(true); 510 SkPaint::GlyphCacheProc glyphCacheProc = paint.getGlyphCacheProc(true);
511 SkAutoGlyphCache autoCache(paint, &props, nullptr); 511 SkAutoGlyphCache autoCache(paint, &props, nullptr);
512 SkGlyphCache* cache = autoCache.getCache(); 512 SkGlyphCache* cache = autoCache.getCache();
513 513
514 const char* stop = text + byteLength; 514 const char* stop = text + byteLength;
515 SkTextAlignProc alignProc(paint.getTextAlign()); 515 SkTextAlignProc alignProc(paint.getTextAlign());
516 SkTextMapStateProc tmsProc(SkMatrix::I(), offset, scalarsPerPosition); 516 SkTextMapStateProc tmsProc(SkMatrix::I(), offset, scalarsPerPosition);
517 517
518 // Now restore the original settings, so we "draw" with whatever style/strok ing. 518 // Now restore the original settings, so we "draw" with whatever style/strok ing.
519 paint.setStyle(origPaint.getStyle()); 519 paint.setStyle(origPaint.getStyle());
520 paint.setPathEffect(origPaint.getPathEffect()); 520 paint.setPathEffect(sk_ref_sp(origPaint.getPathEffect()));
521 521
522 while (text < stop) { 522 while (text < stop) {
523 const SkGlyph& glyph = glyphCacheProc(cache, &text); 523 const SkGlyph& glyph = glyphCacheProc(cache, &text);
524 if (glyph.fWidth) { 524 if (glyph.fWidth) {
525 const SkPath* path = cache->findPath(glyph); 525 const SkPath* path = cache->findPath(glyph);
526 if (path) { 526 if (path) {
527 SkPoint tmsLoc; 527 SkPoint tmsLoc;
528 tmsProc(pos, &tmsLoc); 528 tmsProc(pos, &tmsLoc);
529 SkPoint loc; 529 SkPoint loc;
530 alignProc(tmsLoc, glyph, &loc); 530 alignProc(tmsLoc, glyph, &loc);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 if (cache->getAuxProcData(glyph_cache_aux_proc, &auxData)) { 575 if (cache->getAuxProcData(glyph_cache_aux_proc, &auxData)) {
576 scaler = (GrFontScaler*)auxData; 576 scaler = (GrFontScaler*)auxData;
577 } 577 }
578 if (nullptr == scaler) { 578 if (nullptr == scaler) {
579 scaler = new GrFontScaler(cache); 579 scaler = new GrFontScaler(cache);
580 cache->setAuxProc(glyph_cache_aux_proc, scaler); 580 cache->setAuxProc(glyph_cache_aux_proc, scaler);
581 } 581 }
582 582
583 return scaler; 583 return scaler;
584 } 584 }
OLDNEW
« no previous file with comments | « src/effects/SkLayerDrawLooper.cpp ('k') | src/pdf/SkPDFDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698