OLD | NEW |
---|---|
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 Loading... | |
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 } |
OLD | NEW |