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 1832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1843 } | 1843 } |
1844 } | 1844 } |
1845 | 1845 |
1846 SkSurface* SkGpuDevice::newSurface(const SkImageInfo& info) { | 1846 SkSurface* SkGpuDevice::newSurface(const SkImageInfo& info) { |
1847 return SkSurface::NewRenderTarget(fContext, info, fRenderTarget->numSamples(
)); | 1847 return SkSurface::NewRenderTarget(fContext, info, fRenderTarget->numSamples(
)); |
1848 } | 1848 } |
1849 | 1849 |
1850 void SkGpuDevice::EXPERIMENTAL_optimize(const SkPicture* picture) { | 1850 void SkGpuDevice::EXPERIMENTAL_optimize(const SkPicture* picture) { |
1851 fContext->getLayerCache()->processDeletedPictures(); | 1851 fContext->getLayerCache()->processDeletedPictures(); |
1852 | 1852 |
1853 if (NULL != picture->fData.get() && picture->fData->suitableForLayerOptimiza
tion()) { | |
1854 return; | |
1855 } | |
1856 | |
1857 SkPicture::AccelData::Key key = GPUAccelData::ComputeAccelDataKey(); | 1853 SkPicture::AccelData::Key key = GPUAccelData::ComputeAccelDataKey(); |
1858 | 1854 |
1859 const SkPicture::AccelData* existing = picture->EXPERIMENTAL_getAccelData(ke
y); | 1855 const SkPicture::AccelData* existing = picture->EXPERIMENTAL_getAccelData(ke
y); |
1860 if (NULL != existing) { | 1856 if (NULL != existing) { |
1861 return; | 1857 return; |
1862 } | 1858 } |
1863 | 1859 |
1864 SkAutoTUnref<GPUAccelData> data(SkNEW_ARGS(GPUAccelData, (key))); | 1860 SkAutoTUnref<GPUAccelData> data(SkNEW_ARGS(GPUAccelData, (key))); |
1865 | 1861 |
1866 picture->EXPERIMENTAL_addAccelData(data); | 1862 picture->EXPERIMENTAL_addAccelData(data); |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2134 } | 2130 } |
2135 | 2131 |
2136 return true; | 2132 return true; |
2137 } | 2133 } |
2138 | 2134 |
2139 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 2135 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
2140 // We always return a transient cache, so it is freed after each | 2136 // We always return a transient cache, so it is freed after each |
2141 // filter traversal. | 2137 // filter traversal. |
2142 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); | 2138 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); |
2143 } | 2139 } |
OLD | NEW |