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

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

Issue 1982303002: Make GrFontScaler not be ref-counted (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: update INHERITED Created 4 years, 7 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/text/GrFontScaler.h ('k') | 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 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 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 if (kUnknown_SkPixelGeometry == surfaceProps.pixelGeometry() || ShouldDisabl eLCD(paint)) { 565 if (kUnknown_SkPixelGeometry == surfaceProps.pixelGeometry() || ShouldDisabl eLCD(paint)) {
566 flags &= ~SkPaint::kLCDRenderText_Flag; 566 flags &= ~SkPaint::kLCDRenderText_Flag;
567 flags |= SkPaint::kGenA8FromLCD_Flag; 567 flags |= SkPaint::kGenA8FromLCD_Flag;
568 } 568 }
569 569
570 return flags; 570 return flags;
571 } 571 }
572 572
573 static void glyph_cache_aux_proc(void* data) { 573 static void glyph_cache_aux_proc(void* data) {
574 GrFontScaler* scaler = (GrFontScaler*)data; 574 GrFontScaler* scaler = (GrFontScaler*)data;
575 SkSafeUnref(scaler); 575 delete scaler;
576 } 576 }
577 577
578 GrFontScaler* GrTextUtils::GetGrFontScaler(SkGlyphCache* cache) { 578 GrFontScaler* GrTextUtils::GetGrFontScaler(SkGlyphCache* cache) {
bungeman-skia 2016/05/17 14:14:05 It actually seems strange that this is in GrTextUt
579 void* auxData; 579 void* auxData;
580 GrFontScaler* scaler = nullptr; 580 GrFontScaler* scaler = nullptr;
581 581
582 if (cache->getAuxProcData(glyph_cache_aux_proc, &auxData)) { 582 if (cache->getAuxProcData(glyph_cache_aux_proc, &auxData)) {
583 scaler = (GrFontScaler*)auxData; 583 scaler = (GrFontScaler*)auxData;
584 } 584 }
585 if (nullptr == scaler) { 585 if (nullptr == scaler) {
586 scaler = new GrFontScaler(cache); 586 scaler = new GrFontScaler(cache);
587 cache->setAuxProc(glyph_cache_aux_proc, scaler); 587 cache->setAuxProc(glyph_cache_aux_proc, scaler);
588 } 588 }
589 589
590 return scaler; 590 return scaler;
591 } 591 }
OLDNEW
« no previous file with comments | « src/gpu/text/GrFontScaler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698