Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 283703007: Update layer-pre-rendering for Chrome flag (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698