| 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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 } | 243 } |
| 244 if (resourceBytes) { | 244 if (resourceBytes) { |
| 245 *resourceBytes = fResourceCache->getCachedResourceBytes(); | 245 *resourceBytes = fResourceCache->getCachedResourceBytes(); |
| 246 } | 246 } |
| 247 } | 247 } |
| 248 | 248 |
| 249 GrTextContext* GrContext::createTextContext(GrRenderTarget* renderTarget, | 249 GrTextContext* GrContext::createTextContext(GrRenderTarget* renderTarget, |
| 250 const SkDeviceProperties& | 250 const SkDeviceProperties& |
| 251 leakyProperties, | 251 leakyProperties, |
| 252 bool enableDistanceFieldFonts) { | 252 bool enableDistanceFieldFonts) { |
| 253 if (fGpu->caps()->pathRenderingSupport()) { | 253 if (fGpu->caps()->pathRenderingSupport() && renderTarget->getStencilBuffer()
&& |
| 254 if (renderTarget->getStencilBuffer() && renderTarget->isMultisampled())
{ | 254 renderTarget->isMultisampled())
{ |
| 255 return SkNEW_ARGS(GrStencilAndCoverTextContext, (this, leakyProperti
es)); | 255 return GrStencilAndCoverTextContext::Create(this, leakyProperties); |
| 256 } | 256 } |
| 257 } | 257 |
| 258 return SkNEW_ARGS(GrDistanceFieldTextContext, (this, leakyProperties, | 258 return GrDistanceFieldTextContext::Create(this, leakyProperties, enableDista
nceFieldFonts); |
| 259 enableDistanceFieldFonts)); | |
| 260 } | 259 } |
| 261 | 260 |
| 262 //////////////////////////////////////////////////////////////////////////////// | 261 //////////////////////////////////////////////////////////////////////////////// |
| 263 | 262 |
| 264 GrTexture* GrContext::findAndRefTexture(const GrTextureDesc& desc, | 263 GrTexture* GrContext::findAndRefTexture(const GrTextureDesc& desc, |
| 265 const GrCacheID& cacheID, | 264 const GrCacheID& cacheID, |
| 266 const GrTextureParams* params) { | 265 const GrTextureParams* params) { |
| 267 GrResourceKey resourceKey = GrTexturePriv::ComputeKey(fGpu, params, desc, ca
cheID); | 266 GrResourceKey resourceKey = GrTexturePriv::ComputeKey(fGpu, params, desc, ca
cheID); |
| 268 GrGpuResource* resource = fResourceCache->find(resourceKey); | 267 GrGpuResource* resource = fResourceCache->find(resourceKey); |
| 269 SkSafeRef(resource); | 268 SkSafeRef(resource); |
| (...skipping 1592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1862 fResourceCache->printStats(); | 1861 fResourceCache->printStats(); |
| 1863 } | 1862 } |
| 1864 #endif | 1863 #endif |
| 1865 | 1864 |
| 1866 #if GR_GPU_STATS | 1865 #if GR_GPU_STATS |
| 1867 const GrContext::GPUStats* GrContext::gpuStats() const { | 1866 const GrContext::GPUStats* GrContext::gpuStats() const { |
| 1868 return fGpu->gpuStats(); | 1867 return fGpu->gpuStats(); |
| 1869 } | 1868 } |
| 1870 #endif | 1869 #endif |
| 1871 | 1870 |
| OLD | NEW |