summaryrefslogtreecommitdiff
path: root/libs/hwui/Properties.cpp
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2017-11-09 16:21:21 -0800
committerJohn Reck <jreck@google.com>2017-11-09 16:21:21 -0800
commit113ddd9ef5a05e340d476e05edc971b5c2f80c26 (patch)
tree8067e7eb28e6133c1296d624e125b551e131deb3 /libs/hwui/Properties.cpp
parent3b382900a81a10498fc35e927086982bc8e18437 (diff)
Allow hwuimacro to choose a renderer
Test: this Change-Id: I500b033257f317f8a3124e8072dc8d39d666b01b
Diffstat (limited to 'libs/hwui/Properties.cpp')
-rw-r--r--libs/hwui/Properties.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/libs/hwui/Properties.cpp b/libs/hwui/Properties.cpp
index d90caf9f7b94..d41db63aed92 100644
--- a/libs/hwui/Properties.cpp
+++ b/libs/hwui/Properties.cpp
@@ -178,7 +178,7 @@ ProfileType Properties::getProfileType() {
}
RenderPipelineType Properties::getRenderPipelineType() {
- if (RenderPipelineType::NotInitialized != sRenderPipelineType) {
+ if (sRenderPipelineType != RenderPipelineType::NotInitialized) {
return sRenderPipelineType;
}
char prop[PROPERTY_VALUE_MAX];
@@ -196,11 +196,17 @@ RenderPipelineType Properties::getRenderPipelineType() {
return sRenderPipelineType;
}
-#ifdef HWUI_GLES_WRAP_ENABLED
void Properties::overrideRenderPipelineType(RenderPipelineType type) {
+#if !defined(HWUI_GLES_WRAP_ENABLED)
+ // If we're doing actual rendering then we can't change the renderer after it's been set.
+ // Unit tests can freely change this as often as it wants, though, as there's no actual
+ // GL rendering happening
+ if (sRenderPipelineType != RenderPipelineType::NotInitialized) {
+ return;
+ }
+#endif
sRenderPipelineType = type;
}
-#endif
bool Properties::isSkiaEnabled() {
auto renderType = getRenderPipelineType();