summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread
diff options
context:
space:
mode:
author Sally Qi <sallyqi@google.com> 2024-03-09 04:22:11 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-03-09 04:22:11 +0000
commit4400b39a497b2414a76786c2cd30ec69041105df (patch)
tree8374f2dcea32d26d8f99fe6a6daa67838ffc7dd8 /libs/hwui/renderthread
parent8472c5b03594568356ee46611e3dac10fdd1858c (diff)
parent5f076a6359203ead7c955fb7259b330ac8de9213 (diff)
Merge "Check optional before accessing the data." into main
Diffstat (limited to 'libs/hwui/renderthread')
-rw-r--r--libs/hwui/renderthread/CanvasContext.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp
index 1d0330185b1c..abf64d099935 100644
--- a/libs/hwui/renderthread/CanvasContext.cpp
+++ b/libs/hwui/renderthread/CanvasContext.cpp
@@ -411,7 +411,8 @@ void CanvasContext::prepareTree(TreeInfo& info, int64_t* uiFrameInfo, int64_t sy
// If the previous frame was dropped we don't need to hold onto it, so
// just keep using the previous frame's structure instead
- if (const auto reason = wasSkipped(mCurrentFrameInfo)) {
+ const auto reason = wasSkipped(mCurrentFrameInfo);
+ if (reason.has_value()) {
// Use the oldest skipped frame in case we skip more than a single frame
if (!mSkippedFrameInfo) {
switch (*reason) {