| 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 if (resourceBytes) { | 219 if (resourceBytes) { |
| 220 *resourceBytes = fResourceCache->getBudgetedResourceBytes(); | 220 *resourceBytes = fResourceCache->getBudgetedResourceBytes(); |
| 221 } | 221 } |
| 222 } | 222 } |
| 223 | 223 |
| 224 GrTextContext* GrContext::createTextContext(GrRenderTarget* renderTarget, | 224 GrTextContext* GrContext::createTextContext(GrRenderTarget* renderTarget, |
| 225 SkGpuDevice* gpuDevice, | 225 SkGpuDevice* gpuDevice, |
| 226 const SkDeviceProperties& | 226 const SkDeviceProperties& |
| 227 leakyProperties, | 227 leakyProperties, |
| 228 bool enableDistanceFieldFonts) { | 228 bool enableDistanceFieldFonts) { |
| 229 if (fGpu->caps()->pathRenderingSupport() && renderTarget->isMultisampled())
{ | 229 if (fGpu->caps()->shaderCaps()->pathRenderingSupport() && renderTarget->isMu
ltisampled()) { |
| 230 GrStencilAttachment* sb = renderTarget->renderTargetPriv().attachStencil
Attachment(); | 230 GrStencilAttachment* sb = renderTarget->renderTargetPriv().attachStencil
Attachment(); |
| 231 if (sb) { | 231 if (sb) { |
| 232 return GrStencilAndCoverTextContext::Create(this, gpuDevice, leakyPr
operties); | 232 return GrStencilAndCoverTextContext::Create(this, gpuDevice, leakyPr
operties); |
| 233 } | 233 } |
| 234 } | 234 } |
| 235 | 235 |
| 236 return GrAtlasTextContext::Create(this, gpuDevice, leakyProperties, enableDi
stanceFieldFonts); | 236 return GrAtlasTextContext::Create(this, gpuDevice, leakyProperties, enableDi
stanceFieldFonts); |
| 237 } | 237 } |
| 238 | 238 |
| 239 //////////////////////////////////////////////////////////////////////////////// | 239 //////////////////////////////////////////////////////////////////////////////// |
| (...skipping 1641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1881 bool GrContext::isConfigRenderable(GrPixelConfig config, bool withMSAA) const { | 1881 bool GrContext::isConfigRenderable(GrPixelConfig config, bool withMSAA) const { |
| 1882 return fGpu->caps()->isConfigRenderable(config, withMSAA); | 1882 return fGpu->caps()->isConfigRenderable(config, withMSAA); |
| 1883 } | 1883 } |
| 1884 | 1884 |
| 1885 int GrContext::getRecommendedSampleCount(GrPixelConfig config, | 1885 int GrContext::getRecommendedSampleCount(GrPixelConfig config, |
| 1886 SkScalar dpi) const { | 1886 SkScalar dpi) const { |
| 1887 if (!this->isConfigRenderable(config, true)) { | 1887 if (!this->isConfigRenderable(config, true)) { |
| 1888 return 0; | 1888 return 0; |
| 1889 } | 1889 } |
| 1890 int chosenSampleCount = 0; | 1890 int chosenSampleCount = 0; |
| 1891 if (fGpu->caps()->pathRenderingSupport()) { | 1891 if (fGpu->caps()->shaderCaps()->pathRenderingSupport()) { |
| 1892 if (dpi >= 250.0f) { | 1892 if (dpi >= 250.0f) { |
| 1893 chosenSampleCount = 4; | 1893 chosenSampleCount = 4; |
| 1894 } else { | 1894 } else { |
| 1895 chosenSampleCount = 16; | 1895 chosenSampleCount = 16; |
| 1896 } | 1896 } |
| 1897 } | 1897 } |
| 1898 return chosenSampleCount <= fGpu->caps()->maxSampleCount() ? | 1898 return chosenSampleCount <= fGpu->caps()->maxSampleCount() ? |
| 1899 chosenSampleCount : 0; | 1899 chosenSampleCount : 0; |
| 1900 } | 1900 } |
| 1901 | 1901 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2008 } | 2008 } |
| 2009 } | 2009 } |
| 2010 | 2010 |
| 2011 void GrContext::removeGpuTraceMarker(const GrGpuTraceMarker* marker) { | 2011 void GrContext::removeGpuTraceMarker(const GrGpuTraceMarker* marker) { |
| 2012 fGpu->removeGpuTraceMarker(marker); | 2012 fGpu->removeGpuTraceMarker(marker); |
| 2013 if (fDrawBuffer) { | 2013 if (fDrawBuffer) { |
| 2014 fDrawBuffer->removeGpuTraceMarker(marker); | 2014 fDrawBuffer->removeGpuTraceMarker(marker); |
| 2015 } | 2015 } |
| 2016 } | 2016 } |
| 2017 | 2017 |
| OLD | NEW |