Index: src/gpu/SkGpuDevice.cpp |
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp |
index 3e6bf1b6e429739a9275d656a93f6874c83ba2fc..e459a116dfc975b98ff94dbd2024111ac8d305dc 100644 |
--- a/src/gpu/SkGpuDevice.cpp |
+++ b/src/gpu/SkGpuDevice.cpp |
@@ -1850,6 +1850,10 @@ SkSurface* SkGpuDevice::newSurface(const SkImageInfo& info) { |
void SkGpuDevice::EXPERIMENTAL_optimize(const SkPicture* picture) { |
fContext->getLayerCache()->processDeletedPictures(); |
+ if (NULL != picture->fData.get() && !picture->fData->suitableForLayerOptimization()) { |
+ return; |
+ } |
+ |
SkPicture::AccelData::Key key = GPUAccelData::ComputeAccelDataKey(); |
const SkPicture::AccelData* existing = picture->EXPERIMENTAL_getAccelData(key); |