aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/SkGpuDevice.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2014-09-30 11:33:02 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-09-30 11:33:02 -0700
commitb5a97154f893a5fd3495e16872d370124e93c6ca (patch)
treee139e1d58496b906d9c50652641cf3afa65cd081 /src/gpu/SkGpuDevice.cpp
parent5bc760a6a6a61ff462a204e0c051ad6147760223 (diff)
Allow previously-hoisted layers to be reused in the same draw
In the Sierpinkski test case there are only a few layers appear in the "to be drawn" lists but they those layers get reused a lot of times with different transforms. This CL adds an additional category to allow such layers to be placed in the GrReplacements object without needing to be rendered. This is split out of (Fix sub-picture layer rendering bugs - https://codereview.chromium.org/597293002/) BUG=skia:2315 R=bsalomon@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/616023002
Diffstat (limited to 'src/gpu/SkGpuDevice.cpp')
-rw-r--r--src/gpu/SkGpuDevice.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 30b3668d6b..455a8abe01 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1850,23 +1850,23 @@ bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture
return true;
}
- SkTDArray<GrLayerHoister::HoistedLayer> atlased, nonAtlased;
+ SkTDArray<GrLayerHoister::HoistedLayer> atlased, nonAtlased, recycled;
if (!GrLayerHoister::FindLayersToHoist(mainPicture, clipBounds, &atlased, &nonAtlased,
- fContext->getLayerCache())) {
+ &recycled, fContext->getLayerCache())) {
return false;
}
GrReplacements replacements;
- GrLayerHoister::DrawLayers(atlased, nonAtlased, &replacements);
+ GrLayerHoister::DrawLayers(atlased, nonAtlased, recycled, &replacements);
// Render the entire picture using new layers
const SkMatrix initialMatrix = mainCanvas->getTotalMatrix();
GrRecordReplaceDraw(mainPicture, mainCanvas, &replacements, initialMatrix, NULL);
- GrLayerHoister::UnlockLayers(fContext->getLayerCache(), atlased, nonAtlased);
+ GrLayerHoister::UnlockLayers(fContext->getLayerCache(), atlased, nonAtlased, recycled);
return true;
}