| 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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 void GrContext::getResourceCacheUsage(int* resourceCount, size_t* resourceBytes)
const { | 237 void GrContext::getResourceCacheUsage(int* resourceCount, size_t* resourceBytes)
const { |
| 238 if (resourceCount) { | 238 if (resourceCount) { |
| 239 *resourceCount = fResourceCache->getBudgetedResourceCount(); | 239 *resourceCount = fResourceCache->getBudgetedResourceCount(); |
| 240 } | 240 } |
| 241 if (resourceBytes) { | 241 if (resourceBytes) { |
| 242 *resourceBytes = fResourceCache->getBudgetedResourceBytes(); | 242 *resourceBytes = fResourceCache->getBudgetedResourceBytes(); |
| 243 } | 243 } |
| 244 } | 244 } |
| 245 | 245 |
| 246 GrTextContext* GrContext::createTextContext(GrRenderTarget* renderTarget, | 246 GrTextContext* GrContext::createTextContext(GrRenderTarget* renderTarget, |
| 247 SkGpuDevice* gpuDevice, | |
| 248 const SkDeviceProperties& | 247 const SkDeviceProperties& |
| 249 leakyProperties, | 248 leakyProperties, |
| 250 bool enableDistanceFieldFonts) { | 249 bool enableDistanceFieldFonts) { |
| 251 if (fGpu->caps()->shaderCaps()->pathRenderingSupport() && renderTarget->isMu
ltisampled()) { | 250 if (fGpu->caps()->shaderCaps()->pathRenderingSupport() && renderTarget->isMu
ltisampled()) { |
| 252 GrStencilAttachment* sb = renderTarget->renderTargetPriv().attachStencil
Attachment(); | 251 GrStencilAttachment* sb = renderTarget->renderTargetPriv().attachStencil
Attachment(); |
| 253 if (sb) { | 252 if (sb) { |
| 254 return GrStencilAndCoverTextContext::Create(this, gpuDevice, leakyPr
operties); | 253 return GrStencilAndCoverTextContext::Create(this, leakyProperties); |
| 255 } | 254 } |
| 256 } | 255 } |
| 257 | 256 |
| 258 return GrAtlasTextContext::Create(this, gpuDevice, leakyProperties, enableDi
stanceFieldFonts); | 257 return GrAtlasTextContext::Create(this, leakyProperties, enableDistanceField
Fonts); |
| 259 } | 258 } |
| 260 | 259 |
| 261 //////////////////////////////////////////////////////////////////////////////// | 260 //////////////////////////////////////////////////////////////////////////////// |
| 262 | 261 |
| 263 bool GrContext::shaderDerivativeSupport() const { | 262 bool GrContext::shaderDerivativeSupport() const { |
| 264 return fGpu->caps()->shaderCaps()->shaderDerivativeSupport(); | 263 return fGpu->caps()->shaderCaps()->shaderDerivativeSupport(); |
| 265 } | 264 } |
| 266 | 265 |
| 267 bool GrContext::isConfigTexturable(GrPixelConfig config) const { | 266 bool GrContext::isConfigTexturable(GrPixelConfig config) const { |
| 268 return fGpu->caps()->isConfigTexturable(config); | 267 return fGpu->caps()->isConfigTexturable(config); |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 770 ////////////////////////////////////////////////////////////////////////////// | 769 ////////////////////////////////////////////////////////////////////////////// |
| 771 | 770 |
| 772 void GrContext::addGpuTraceMarker(const GrGpuTraceMarker* marker) { | 771 void GrContext::addGpuTraceMarker(const GrGpuTraceMarker* marker) { |
| 773 fGpu->addGpuTraceMarker(marker); | 772 fGpu->addGpuTraceMarker(marker); |
| 774 } | 773 } |
| 775 | 774 |
| 776 void GrContext::removeGpuTraceMarker(const GrGpuTraceMarker* marker) { | 775 void GrContext::removeGpuTraceMarker(const GrGpuTraceMarker* marker) { |
| 777 fGpu->removeGpuTraceMarker(marker); | 776 fGpu->removeGpuTraceMarker(marker); |
| 778 } | 777 } |
| 779 | 778 |
| OLD | NEW |