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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 657383004: Alter layer hoisting to only hoist layers for one canvas at a time (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix noGPU build Created 6 years, 2 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/GpuLayerCacheTest.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 07b7f75e92a2bd2ff9a269855fe526fe39de6287..086dbdcdbd079ae0e9eafd65f41222dc9677fe3f 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1816,23 +1816,36 @@ bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture
return true;
}
- SkTDArray<GrHoistedLayer> atlased, nonAtlased, recycled;
+ SkTDArray<GrHoistedLayer> atlasedNeedRendering, atlasedRecycled;
- if (!GrLayerHoister::FindLayersToHoist(fContext, mainPicture, clipBounds,
- &atlased, &nonAtlased, &recycled)) {
- return false;
- }
+ GrLayerHoister::FindLayersToAtlas(fContext, mainPicture,
+ clipBounds,
+ &atlasedNeedRendering, &atlasedRecycled);
+
+ GrLayerHoister::DrawLayersToAtlas(fContext, atlasedNeedRendering);
+
+ SkTDArray<GrHoistedLayer> needRendering, recycled;
+
+ GrLayerHoister::FindLayersToHoist(fContext, mainPicture,
+ clipBounds,
+ &needRendering, &recycled);
+
+ GrLayerHoister::DrawLayers(fContext, needRendering);
GrReplacements replacements;
- GrLayerHoister::DrawLayers(fContext, atlased, nonAtlased, recycled, &replacements);
+ GrLayerHoister::ConvertLayersToReplacements(needRendering, &replacements);
+ GrLayerHoister::ConvertLayersToReplacements(recycled, &replacements);
// Render the entire picture using new layers
const SkMatrix initialMatrix = mainCanvas->getTotalMatrix();
GrRecordReplaceDraw(mainPicture, mainCanvas, &replacements, initialMatrix, NULL);
- GrLayerHoister::UnlockLayers(fContext, atlased, nonAtlased, recycled);
+ GrLayerHoister::UnlockLayers(fContext, needRendering);
+ GrLayerHoister::UnlockLayers(fContext, recycled);
+ GrLayerHoister::UnlockLayers(fContext, atlasedNeedRendering);
+ GrLayerHoister::UnlockLayers(fContext, atlasedRecycled);
return true;
}
« no previous file with comments | « src/gpu/GrPictureUtils.cpp ('k') | tests/GpuLayerCacheTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698