OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "GrContext.h" | 9 #include "GrContext.h" |
10 | 10 |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 void GrContext::getResourceCacheUsage(int* resourceCount, size_t* resourceBytes)
const { | 208 void GrContext::getResourceCacheUsage(int* resourceCount, size_t* resourceBytes)
const { |
209 if (resourceCount) { | 209 if (resourceCount) { |
210 *resourceCount = fResourceCache->getBudgetedResourceCount(); | 210 *resourceCount = fResourceCache->getBudgetedResourceCount(); |
211 } | 211 } |
212 if (resourceBytes) { | 212 if (resourceBytes) { |
213 *resourceBytes = fResourceCache->getBudgetedResourceBytes(); | 213 *resourceBytes = fResourceCache->getBudgetedResourceBytes(); |
214 } | 214 } |
215 } | 215 } |
216 | 216 |
217 GrTextContext* GrContext::createTextContext(GrRenderTarget* renderTarget, | 217 GrTextContext* GrContext::createTextContext(GrRenderTarget* renderTarget, |
| 218 SkGpuDevice* gpuDevice, |
218 const SkDeviceProperties& | 219 const SkDeviceProperties& |
219 leakyProperties, | 220 leakyProperties, |
220 bool enableDistanceFieldFonts) { | 221 bool enableDistanceFieldFonts) { |
221 if (fGpu->caps()->pathRenderingSupport() && renderTarget->isMultisampled())
{ | 222 if (fGpu->caps()->pathRenderingSupport() && renderTarget->isMultisampled())
{ |
222 GrStencilBuffer* sb = renderTarget->renderTargetPriv().attachStencilBuff
er(); | 223 GrStencilBuffer* sb = renderTarget->renderTargetPriv().attachStencilBuff
er(); |
223 if (sb) { | 224 if (sb) { |
224 return GrStencilAndCoverTextContext::Create(this, leakyProperties); | 225 return GrStencilAndCoverTextContext::Create(this, gpuDevice, leakyPr
operties); |
225 } | 226 } |
226 } | 227 } |
227 | 228 |
228 return GrDistanceFieldTextContext::Create(this, leakyProperties, enableDista
nceFieldFonts); | 229 return GrDistanceFieldTextContext::Create(this, gpuDevice, leakyProperties, |
| 230 enableDistanceFieldFonts); |
229 } | 231 } |
230 | 232 |
231 //////////////////////////////////////////////////////////////////////////////// | 233 //////////////////////////////////////////////////////////////////////////////// |
232 enum ScratchTextureFlags { | 234 enum ScratchTextureFlags { |
233 kExact_ScratchTextureFlag = 0x1, | 235 kExact_ScratchTextureFlag = 0x1, |
234 kNoPendingIO_ScratchTextureFlag = 0x2, | 236 kNoPendingIO_ScratchTextureFlag = 0x2, |
235 kNoCreate_ScratchTextureFlag = 0x4, | 237 kNoCreate_ScratchTextureFlag = 0x4, |
236 }; | 238 }; |
237 | 239 |
238 bool GrContext::isConfigTexturable(GrPixelConfig config) const { | 240 bool GrContext::isConfigTexturable(GrPixelConfig config) const { |
(...skipping 1758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1997 } | 1999 } |
1998 } | 2000 } |
1999 | 2001 |
2000 void GrContext::removeGpuTraceMarker(const GrGpuTraceMarker* marker) { | 2002 void GrContext::removeGpuTraceMarker(const GrGpuTraceMarker* marker) { |
2001 fGpu->removeGpuTraceMarker(marker); | 2003 fGpu->removeGpuTraceMarker(marker); |
2002 if (fDrawBuffer) { | 2004 if (fDrawBuffer) { |
2003 fDrawBuffer->removeGpuTraceMarker(marker); | 2005 fDrawBuffer->removeGpuTraceMarker(marker); |
2004 } | 2006 } |
2005 } | 2007 } |
2006 | 2008 |
OLD | NEW |