Index: src/gpu/SkGpuDevice.cpp |
=================================================================== |
--- src/gpu/SkGpuDevice.cpp (revision 14674) |
+++ src/gpu/SkGpuDevice.cpp (working copy) |
@@ -1942,6 +1942,11 @@ |
void SkGpuDevice::EXPERIMENTAL_optimize(SkPicture* picture) { |
SkPicture::AccelData::Key key = GPUAccelData::ComputeAccelDataKey(); |
+ const SkPicture::AccelData* existing = picture->EXPERIMENTAL_getAccelData(key); |
+ if (NULL != existing) { |
+ return; |
+ } |
+ |
SkAutoTUnref<GPUAccelData> data(SkNEW_ARGS(GPUAccelData, (key))); |
picture->EXPERIMENTAL_addAccelData(data); |
@@ -1970,6 +1975,10 @@ |
const GPUAccelData *gpuData = static_cast<const GPUAccelData*>(data); |
+ if (0 == gpuData->numSaveLayers()) { |
+ return false; |
+ } |
+ |
SkAutoTArray<bool> pullForward(gpuData->numSaveLayers()); |
for (int i = 0; i < gpuData->numSaveLayers(); ++i) { |
pullForward[i] = false; |