summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/CanvasContext.cpp
diff options
context:
space:
mode:
authorGreg Daniel <egdaniel@google.com>2021-04-08 16:17:35 -0400
committerGreg Daniel <egdaniel@google.com>2021-04-08 16:17:35 -0400
commit16d11c6d386914aef1de7fdcc9bac6239c738139 (patch)
tree434d73de986ac8995ff026760c34ec91a87cb0dc /libs/hwui/renderthread/CanvasContext.cpp
parent7d0422a7ca13eb99b3051d69830df4cdeeccb21d (diff)
In CanvasContext check at start of frame if GrContext is abandoned.
On Vulkan part of the abandoned check also checks for device lost. Following what we currently do in GL, we now crash if we are ever in this state. Test: local build Bug: 183722403 Change-Id: I2a41005fd6892e32a8b23dacbc0170d5542fe072
Diffstat (limited to 'libs/hwui/renderthread/CanvasContext.cpp')
-rw-r--r--libs/hwui/renderthread/CanvasContext.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp
index 800c58095041..aedb5c28dc3e 100644
--- a/libs/hwui/renderthread/CanvasContext.cpp
+++ b/libs/hwui/renderthread/CanvasContext.cpp
@@ -452,6 +452,12 @@ void CanvasContext::notifyFramePending() {
}
void CanvasContext::draw() {
+ if (auto grContext = getGrContext()) {
+ if (grContext->abandoned()) {
+ LOG_ALWAYS_FATAL("GrContext is abandoned/device lost at start of CanvasContext::draw");
+ return;
+ }
+ }
SkRect dirty;
mDamageAccumulator.finish(&dirty);