| 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 1759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1770 const GrContext::ScratchTexMatch match = (kSaveLayer_Usage == usage) ? | 1770 const GrContext::ScratchTexMatch match = (kSaveLayer_Usage == usage) ? |
| 1771 GrContext::kApprox_ScratchTexMat
ch : | 1771 GrContext::kApprox_ScratchTexMat
ch : |
| 1772 GrContext::kExact_ScratchTexMatc
h; | 1772 GrContext::kExact_ScratchTexMatc
h; |
| 1773 texture.reset(fContext->refScratchTexture(desc, match)); | 1773 texture.reset(fContext->refScratchTexture(desc, match)); |
| 1774 #else | 1774 #else |
| 1775 texture.reset(fContext->createUncachedTexture(desc, NULL, 0)); | 1775 texture.reset(fContext->createUncachedTexture(desc, NULL, 0)); |
| 1776 #endif | 1776 #endif |
| 1777 if (texture.get()) { | 1777 if (texture.get()) { |
| 1778 return SkGpuDevice::Create(texture, SkSurfaceProps(SkSurfaceProps::kLega
cyFontHost_InitType), flags); | 1778 return SkGpuDevice::Create(texture, SkSurfaceProps(SkSurfaceProps::kLega
cyFontHost_InitType), flags); |
| 1779 } else { | 1779 } else { |
| 1780 GrPrintf("---- failed to create compatible device texture [%d %d]\n", | 1780 SkDebugf("---- failed to create compatible device texture [%d %d]\n", |
| 1781 info.width(), info.height()); | 1781 info.width(), info.height()); |
| 1782 return NULL; | 1782 return NULL; |
| 1783 } | 1783 } |
| 1784 } | 1784 } |
| 1785 | 1785 |
| 1786 SkSurface* SkGpuDevice::newSurface(const SkImageInfo& info, const SkSurfaceProps
& props) { | 1786 SkSurface* SkGpuDevice::newSurface(const SkImageInfo& info, const SkSurfaceProps
& props) { |
| 1787 return SkSurface::NewRenderTarget(fContext, info, fRenderTarget->numSamples(
), &props); | 1787 return SkSurface::NewRenderTarget(fContext, info, fRenderTarget->numSamples(
), &props); |
| 1788 } | 1788 } |
| 1789 | 1789 |
| 1790 void SkGpuDevice::EXPERIMENTAL_optimize(const SkPicture* picture) { | 1790 void SkGpuDevice::EXPERIMENTAL_optimize(const SkPicture* picture) { |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1852 return true; | 1852 return true; |
| 1853 } | 1853 } |
| 1854 | 1854 |
| 1855 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 1855 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
| 1856 // We always return a transient cache, so it is freed after each | 1856 // We always return a transient cache, so it is freed after each |
| 1857 // filter traversal. | 1857 // filter traversal. |
| 1858 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); | 1858 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); |
| 1859 } | 1859 } |
| 1860 | 1860 |
| 1861 #endif | 1861 #endif |
| OLD | NEW |