| 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 1822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1833 result->setInfo(info); | 1833 result->setInfo(info); |
| 1834 result->setPixelRef(SkNEW_ARGS(SkGrPixelRef, (info, texture)))->unref(); | 1834 result->setPixelRef(SkNEW_ARGS(SkGrPixelRef, (info, texture)))->unref(); |
| 1835 } | 1835 } |
| 1836 | 1836 |
| 1837 void SkGpuDevice::EXPERIMENTAL_purge(const SkPicture* picture) { | 1837 void SkGpuDevice::EXPERIMENTAL_purge(const SkPicture* picture) { |
| 1838 fContext->getLayerCache()->purge(picture); | 1838 fContext->getLayerCache()->purge(picture); |
| 1839 } | 1839 } |
| 1840 | 1840 |
| 1841 bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* canvas, const SkPicture* pi
cture) { | 1841 bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* canvas, const SkPicture* pi
cture) { |
| 1842 | 1842 |
| 1843 if (NULL == picture->fData.get()) { | |
| 1844 return false; | |
| 1845 } | |
| 1846 | |
| 1847 SkPicture::AccelData::Key key = GPUAccelData::ComputeAccelDataKey(); | 1843 SkPicture::AccelData::Key key = GPUAccelData::ComputeAccelDataKey(); |
| 1848 | 1844 |
| 1849 const SkPicture::AccelData* data = picture->EXPERIMENTAL_getAccelData(key); | 1845 const SkPicture::AccelData* data = picture->EXPERIMENTAL_getAccelData(key); |
| 1850 if (NULL == data) { | 1846 if (NULL == data) { |
| 1851 return false; | 1847 return false; |
| 1852 } | 1848 } |
| 1853 | 1849 |
| 1854 const GPUAccelData *gpuData = static_cast<const GPUAccelData*>(data); | 1850 const GPUAccelData *gpuData = static_cast<const GPUAccelData*>(data); |
| 1855 | 1851 |
| 1856 if (0 == gpuData->numSaveLayers()) { | 1852 if (0 == gpuData->numSaveLayers()) { |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2035 playback.draw(canvas, NULL); | 2031 playback.draw(canvas, NULL); |
| 2036 | 2032 |
| 2037 // unlock the layers | 2033 // unlock the layers |
| 2038 for (int i = 0; i < gpuData->numSaveLayers(); ++i) { | 2034 for (int i = 0; i < gpuData->numSaveLayers(); ++i) { |
| 2039 GrCachedLayer* layer = fContext->getLayerCache()->findLayer(picture, i); | 2035 GrCachedLayer* layer = fContext->getLayerCache()->findLayer(picture, i); |
| 2040 fContext->getLayerCache()->unlock(layer); | 2036 fContext->getLayerCache()->unlock(layer); |
| 2041 } | 2037 } |
| 2042 | 2038 |
| 2043 return true; | 2039 return true; |
| 2044 } | 2040 } |
| OLD | NEW |