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

Side by Side Diff: src/gpu/SkGpuDevice.cpp

Issue 464433002: Add layer counting to SkPictureRecord (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix bug Created 6 years, 4 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 unified diff | Download patch
« no previous file with comments | « src/core/SkPictureRecord.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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->suitableForLayerOptimiz ation()) {
1854 return;
1855 }
1856
1853 SkPicture::AccelData::Key key = GPUAccelData::ComputeAccelDataKey(); 1857 SkPicture::AccelData::Key key = GPUAccelData::ComputeAccelDataKey();
1854 1858
1855 const SkPicture::AccelData* existing = picture->EXPERIMENTAL_getAccelData(ke y); 1859 const SkPicture::AccelData* existing = picture->EXPERIMENTAL_getAccelData(ke y);
1856 if (NULL != existing) { 1860 if (NULL != existing) {
1857 return; 1861 return;
1858 } 1862 }
1859 1863
1860 SkAutoTUnref<GPUAccelData> data(SkNEW_ARGS(GPUAccelData, (key))); 1864 SkAutoTUnref<GPUAccelData> data(SkNEW_ARGS(GPUAccelData, (key)));
1861 1865
1862 picture->EXPERIMENTAL_addAccelData(data); 1866 picture->EXPERIMENTAL_addAccelData(data);
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
2130 } 2134 }
2131 2135
2132 return true; 2136 return true;
2133 } 2137 }
2134 2138
2135 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { 2139 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() {
2136 // We always return a transient cache, so it is freed after each 2140 // We always return a transient cache, so it is freed after each
2137 // filter traversal. 2141 // filter traversal.
2138 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); 2142 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize);
2139 } 2143 }
OLDNEW
« no previous file with comments | « src/core/SkPictureRecord.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698