diff options
author | Derek Sollenberger <djsollen@google.com> | 2016-11-16 16:00:17 -0500 |
---|---|---|
committer | Derek Sollenberger <djsollen@google.com> | 2016-11-17 09:56:53 -0500 |
commit | 189e87498f666e94dc8c8201e7bac56bb09b9251 (patch) | |
tree | b24033244e56448ae80129daa94442959bfb43c0 /libs/hwui/pipeline/skia/SkiaDisplayList.cpp | |
parent | c4fbada76aa840105553b2c2bce2204e673d2983 (diff) |
Update pinImages to report when GPU resource limits are exceeded.
Bug: 32691999
Test: proposed CTS test (ag/1500396) and existing UiRendering tests
Change-Id: I190f888ae5499ac048569af8256fdd31d19d1285
Diffstat (limited to 'libs/hwui/pipeline/skia/SkiaDisplayList.cpp')
-rw-r--r-- | libs/hwui/pipeline/skia/SkiaDisplayList.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/libs/hwui/pipeline/skia/SkiaDisplayList.cpp b/libs/hwui/pipeline/skia/SkiaDisplayList.cpp index 4abaa90974a6..2ad7f74560d6 100644 --- a/libs/hwui/pipeline/skia/SkiaDisplayList.cpp +++ b/libs/hwui/pipeline/skia/SkiaDisplayList.cpp @@ -53,11 +53,15 @@ void SkiaDisplayList::updateChildren(std::function<void(RenderNode*)> updateFn) bool SkiaDisplayList::prepareListAndChildren(TreeInfo& info, bool functorsNeedLayer, std::function<void(RenderNode*, TreeInfo&, bool)> childFn) { - // If the prepare tree is triggered by the UI thread then we must force all - // mutable images to be pinned in the GPU cache until the next UI thread - // draw - if (info.mode == TreeInfo::MODE_FULL) { - info.prepareTextures = info.canvasContext.pinImages(mMutableImages); + // If the prepare tree is triggered by the UI thread and no previous call to + // pinImages has failed then we must pin all mutable images in the GPU cache + // until the next UI thread draw. + if (info.prepareTextures && !info.canvasContext.pinImages(mMutableImages)) { + // In the event that pinning failed we prevent future pinImage calls for the + // remainder of this tree traversal and also unpin any currently pinned images + // to free up GPU resources. + info.prepareTextures = false; + info.canvasContext.unpinImages(); } for (auto& child : mChildNodes) { |