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

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

Issue 650273003: Change GrTextContext fallbacks to be a linked list chain. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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
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 "GrFontScaler.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 fFallbackTextContext(NULL),
16 fContext(context), fDeviceProperties(properties), fD rawTarget(NULL) { 17 fContext(context), fDeviceProperties(properties), fD rawTarget(NULL) {
17 } 18 }
18 19
20 GrTextContext::~GrTextContext() {
21 SkDELETE(fFallbackTextContext);
bsalomon 2014/10/13 18:46:36 Feels like GrTC should be ref counted.
jvanverth1 2014/10/13 18:54:48 I suppose, but while it's created by GrContext, it
bsalomon 2014/10/13 19:01:44 I'd say either ref count or do as you suggested. H
jvanverth1 2014/10/13 19:06:18 I'll add a factory function for each text context
22 }
23
19 void GrTextContext::init(const GrPaint& grPaint, const SkPaint& skPaint) { 24 void GrTextContext::init(const GrPaint& grPaint, const SkPaint& skPaint) {
20 const GrClipData* clipData = fContext->getClip(); 25 const GrClipData* clipData = fContext->getClip();
21 26
22 SkRect devConservativeBound; 27 SkRect devConservativeBound;
23 clipData->fClipStack->getConservativeBounds( 28 clipData->fClipStack->getConservativeBounds(
24 -clipData->fOrigin.fX, 29 -clipData->fOrigin.fX,
25 -clipData->fOrigin.fY, 30 -clipData->fOrigin.fY,
26 fContext->getRenderTarget()->width(), 31 fContext->getRenderTarget()->width(),
27 fContext->getRenderTarget()->height(), 32 fContext->getRenderTarget()->height(),
28 &devConservativeBound); 33 &devConservativeBound);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 if (cache->getAuxProcData(GlyphCacheAuxProc, &auxData)) { 73 if (cache->getAuxProcData(GlyphCacheAuxProc, &auxData)) {
69 scaler = (GrFontScaler*)auxData; 74 scaler = (GrFontScaler*)auxData;
70 } 75 }
71 if (NULL == scaler) { 76 if (NULL == scaler) {
72 scaler = SkNEW_ARGS(GrFontScaler, (cache)); 77 scaler = SkNEW_ARGS(GrFontScaler, (cache));
73 cache->setAuxProc(GlyphCacheAuxProc, scaler); 78 cache->setAuxProc(GlyphCacheAuxProc, scaler);
74 } 79 }
75 80
76 return scaler; 81 return scaler;
77 } 82 }
OLDNEW
« no previous file with comments | « src/gpu/GrTextContext.h ('k') | src/gpu/SkGpuDevice.h » ('j') | src/gpu/SkGpuDevice.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698