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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 718443002: Change where layer hoisting data is gathered (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix no-GPU build Created 6 years, 1 month 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 | « src/gpu/SkGpuDevice.h ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index b072142a0bd6383520be33a4bc0357f76471289c..06f6eb7778fd8dd925af8fc5683ab924ed4b0f92 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1789,25 +1789,6 @@ SkSurface* SkGpuDevice::newSurface(const SkImageInfo& info, const SkSurfaceProps
return SkSurface::NewRenderTarget(fContext, info, fRenderTarget->numSamples(), &props);
}
-void SkGpuDevice::EXPERIMENTAL_optimize(const SkPicture* picture) {
- fContext->getLayerCache()->processDeletedPictures();
-
- if (picture->fData.get() && !picture->fData->suitableForLayerOptimization()) {
- return;
- }
-
- SkPicture::AccelData::Key key = GrAccelData::ComputeAccelDataKey();
-
- const SkPicture::AccelData* existing = picture->EXPERIMENTAL_getAccelData(key);
- if (existing) {
- return;
- }
-
- GPUOptimize(picture);
-
- fContext->getLayerCache()->trackPicture(picture);
-}
-
bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture* mainPicture,
const SkMatrix* matrix, const SkPaint* paint) {
// todo: should handle these natively
@@ -1815,6 +1796,13 @@ bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture
return false;
}
+ SkPicture::AccelData::Key key = GrAccelData::ComputeAccelDataKey();
+
+ const SkPicture::AccelData* data = mainPicture->EXPERIMENTAL_getAccelData(key);
+ if (!data) {
+ return false;
+ }
+
SkRect clipBounds;
if (!mainCanvas->getClipBounds(&clipBounds)) {
return true;
« no previous file with comments | « src/gpu/SkGpuDevice.h ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698