summaryrefslogtreecommitdiff
path: root/libs/hwui/Properties.h
diff options
context:
space:
mode:
author Brett Chabot <brettchabot@google.com> 2021-07-16 14:38:11 -0700
committer Brett Chabot <brettchabot@google.com> 2021-07-16 22:33:39 +0000
commit074ba590e64013bfa49b5d0da88674603e897fd5 (patch)
treebf6f97f32888415cf77dda5a1bebdc2a7ad3acd1 /libs/hwui/Properties.h
parentc9d121cd948c86ccaafa37d36e4a0166c478a4d6 (diff)
Lazy load Properties::isDrawingEnabled.
Properties::isDrawingEnabled can unexpectedly return true even if the system property debug.hwui.drawing_enabled is false, if its called before RenderThread is created. This commit changes the underlying logic to lazy load the debug.hwui.drawing_enabled prop value. Bug: 193920054 Test: call HardwareRendererCompat.isDrawingEnabled()) from a new test Change-Id: Ib69577745c26595ed3964a4341086138dd5d34b0 (cherry picked from commit 8e1ab42f51c501949211746c46a02a7564ebf292)
Diffstat (limited to 'libs/hwui/Properties.h')
-rw-r--r--libs/hwui/Properties.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/libs/hwui/Properties.h b/libs/hwui/Properties.h
index 73fccb67800b..7f9782bf8d20 100644
--- a/libs/hwui/Properties.h
+++ b/libs/hwui/Properties.h
@@ -214,7 +214,7 @@ enum class StretchEffectBehavior {
UniformScale // Uniform scale stretch everywhere
};
-enum class OverrideDrawingEnabled { Default, On, Off };
+enum class DrawingEnabled { NotInitialized, On, Off };
/**
* Renderthread-only singleton which manages several static rendering properties. Most of these
@@ -309,9 +309,8 @@ public:
stretchEffectBehavior = behavior;
}
- // Represents if GL drawing is enabled. Should only be false in headless testing environments
- static bool drawingEnabled;
- static OverrideDrawingEnabled overrideDrawingEnabled;
+ // Represents if drawing is enabled. Should only be Off in headless testing environments
+ static DrawingEnabled drawingEnabled;
static bool isDrawingEnabled();
static void setDrawingEnabled(bool enable);