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

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

Issue 261783004: Add flag for SkGpuSurface creation to enable distance fields. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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/GrDistanceFieldTextContext.cpp ('k') | src/image/SkSurface_Gpu.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 2011 Google Inc. 2 * Copyright 2011 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 "SkGpuDevice.h" 8 #include "SkGpuDevice.h"
9 9
10 #include "effects/GrBicubicEffect.h" 10 #include "effects/GrBicubicEffect.h"
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 } 183 }
184 184
185 void SkGpuDevice::initFromRenderTarget(GrContext* context, 185 void SkGpuDevice::initFromRenderTarget(GrContext* context,
186 GrRenderTarget* renderTarget, 186 GrRenderTarget* renderTarget,
187 unsigned flags) { 187 unsigned flags) {
188 fDrawProcs = NULL; 188 fDrawProcs = NULL;
189 189
190 fContext = context; 190 fContext = context;
191 fContext->ref(); 191 fContext->ref();
192 192
193 fMainTextContext = SkNEW_ARGS(GrDistanceFieldTextContext, (fContext, fLeakyP roperties)); 193 bool useDFFonts = !!(flags & kDFFonts_Flag);
194 fMainTextContext = SkNEW_ARGS(GrDistanceFieldTextContext, (fContext, fLeakyP roperties,
195 useDFFonts));
194 fFallbackTextContext = SkNEW_ARGS(GrBitmapTextContext, (fContext, fLeakyProp erties)); 196 fFallbackTextContext = SkNEW_ARGS(GrBitmapTextContext, (fContext, fLeakyProp erties));
195 197
196 fRenderTarget = NULL; 198 fRenderTarget = NULL;
197 fNeedClear = flags & kNeedClear_Flag; 199 fNeedClear = flags & kNeedClear_Flag;
198 200
199 SkASSERT(NULL != renderTarget); 201 SkASSERT(NULL != renderTarget);
200 fRenderTarget = renderTarget; 202 fRenderTarget = renderTarget;
201 fRenderTarget->ref(); 203 fRenderTarget->ref();
202 204
203 // Hold onto to the texture in the pixel ref (if there is one) because the t exture holds a ref 205 // Hold onto to the texture in the pixel ref (if there is one) because the t exture holds a ref
(...skipping 1794 matching lines...) Expand 10 before | Expand all | Expand 10 after
1998 const GrCachedLayer* layer = fContext->getLayerCache()->findLayerOrC reate(picture, i); 2000 const GrCachedLayer* layer = fContext->getLayerCache()->findLayerOrC reate(picture, i);
1999 2001
2000 SkDebugf("%d (%d), ", i, layer->layerID()); 2002 SkDebugf("%d (%d), ", i, layer->layerID());
2001 } 2003 }
2002 } 2004 }
2003 SkDebugf("\n"); 2005 SkDebugf("\n");
2004 #endif 2006 #endif
2005 2007
2006 return false; 2008 return false;
2007 } 2009 }
OLDNEW
« no previous file with comments | « src/gpu/GrDistanceFieldTextContext.cpp ('k') | src/image/SkSurface_Gpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698