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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 595543002: Update layer hoisting code to correctly render sub-picture layers (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add cast Created 6 years, 3 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 | « src/gpu/GrPictureUtils.cpp ('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 bebc3980bd76863d175e7685b66ed7d14c35dcae..b6476134d31d15b7b517079836471548cdba45a9 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1838,7 +1838,7 @@ void SkGpuDevice::EXPERIMENTAL_optimize(const SkPicture* picture) {
fContext->getLayerCache()->trackPicture(picture);
}
-bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture* picture,
+bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture* mainPicture,
const SkMatrix* matrix, const SkPaint* paint) {
// todo: should handle these natively
if (matrix || paint) {
@@ -1847,38 +1847,27 @@ bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture
fContext->getLayerCache()->processDeletedPictures();
- SkPicture::AccelData::Key key = GrAccelData::ComputeAccelDataKey();
-
- const SkPicture::AccelData* data = picture->EXPERIMENTAL_getAccelData(key);
- if (NULL == data) {
- return false;
- }
-
- const GrAccelData *gpuData = static_cast<const GrAccelData*>(data);
- if (0 == gpuData->numSaveLayers()) {
- return false;
- }
-
SkRect clipBounds;
if (!mainCanvas->getClipBounds(&clipBounds)) {
return true;
}
- SkTDArray<GrCachedLayer*> atlased, nonAtlased;
+ SkTDArray<GrLayerHoister::HoistedLayer> atlased, nonAtlased;
- if (!GrLayerHoister::FindLayersToHoist(gpuData, clipBounds, &atlased, &nonAtlased,
+ if (!GrLayerHoister::FindLayersToHoist(mainPicture, clipBounds, &atlased, &nonAtlased,
fContext->getLayerCache())) {
return false;
}
GrReplacements replacements;
- GrLayerHoister::DrawLayers(picture, atlased, nonAtlased, &replacements);
+ GrLayerHoister::DrawLayers(atlased, nonAtlased, &replacements);
// Render the entire picture using new layers
- GrRecordReplaceDraw(*picture->fRecord, mainCanvas, picture->fBBH.get(), &replacements, NULL);
+ GrRecordReplaceDraw(*mainPicture->fRecord, mainCanvas, mainPicture->fBBH.get(),
+ &replacements, NULL);
- GrLayerHoister::UnlockLayers(fContext->getLayerCache(), picture);
+ GrLayerHoister::UnlockLayers(fContext->getLayerCache(), atlased, nonAtlased);
return true;
}
« no previous file with comments | « src/gpu/GrPictureUtils.cpp ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698