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

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

Issue 385263002: Refactor SkGrFontScaler and SkGrFontKey into non-virtual versions. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase to ToT Created 6 years, 5 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/GrFontScaler.cpp ('k') | src/gpu/GrTextStrike.h » ('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 2010 Google Inc. 2 * Copyright 2010 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 "GrTextContext.h" 8 #include "GrTextContext.h"
9 #include "GrContext.h" 9 #include "GrContext.h"
10 10
11 #include "SkAutoKern.h" 11 #include "SkAutoKern.h"
12 #include "SkGlyphCache.h" 12 #include "SkGlyphCache.h"
13 #include "SkGr.h" 13 #include "GrFontScaler.h"
14 14
15 GrTextContext::GrTextContext(GrContext* context, const SkDeviceProperties& prope rties) : 15 GrTextContext::GrTextContext(GrContext* context, const SkDeviceProperties& prope rties) :
16 fContext(context), fDeviceProperties(properties), fD rawTarget(NULL) { 16 fContext(context), fDeviceProperties(properties), fD rawTarget(NULL) {
17 } 17 }
18 18
19 void GrTextContext::init(const GrPaint& grPaint, const SkPaint& skPaint) { 19 void GrTextContext::init(const GrPaint& grPaint, const SkPaint& skPaint) {
20 const GrClipData* clipData = fContext->getClip(); 20 const GrClipData* clipData = fContext->getClip();
21 21
22 SkRect devConservativeBound; 22 SkRect devConservativeBound;
23 clipData->fClipStack->getConservativeBounds( 23 clipData->fClipStack->getConservativeBounds(
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 } 62 }
63 63
64 GrFontScaler* GrTextContext::GetGrFontScaler(SkGlyphCache* cache) { 64 GrFontScaler* GrTextContext::GetGrFontScaler(SkGlyphCache* cache) {
65 void* auxData; 65 void* auxData;
66 GrFontScaler* scaler = NULL; 66 GrFontScaler* scaler = NULL;
67 67
68 if (cache->getAuxProcData(GlyphCacheAuxProc, &auxData)) { 68 if (cache->getAuxProcData(GlyphCacheAuxProc, &auxData)) {
69 scaler = (GrFontScaler*)auxData; 69 scaler = (GrFontScaler*)auxData;
70 } 70 }
71 if (NULL == scaler) { 71 if (NULL == scaler) {
72 scaler = SkNEW_ARGS(SkGrFontScaler, (cache)); 72 scaler = SkNEW_ARGS(GrFontScaler, (cache));
73 cache->setAuxProc(GlyphCacheAuxProc, scaler); 73 cache->setAuxProc(GlyphCacheAuxProc, scaler);
74 } 74 }
75 75
76 return scaler; 76 return scaler;
77 } 77 }
OLDNEW
« no previous file with comments | « src/gpu/GrFontScaler.cpp ('k') | src/gpu/GrTextStrike.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698