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