summaryrefslogtreecommitdiff
path: root/libs/hwui/Properties.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/Properties.cpp')
-rw-r--r--libs/hwui/Properties.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/libs/hwui/Properties.cpp b/libs/hwui/Properties.cpp
index ba44d056dda3..65f4e8c8ecec 100644
--- a/libs/hwui/Properties.cpp
+++ b/libs/hwui/Properties.cpp
@@ -15,7 +15,9 @@
*/
#include "Properties.h"
+
#include "Debug.h"
+#include "log/log_main.h"
#ifdef __ANDROID__
#include "HWUIProperties.sysprop.h"
#endif
@@ -190,15 +192,12 @@ RenderPipelineType Properties::getRenderPipelineType() {
return sRenderPipelineType;
}
-void Properties::overrideRenderPipelineType(RenderPipelineType type) {
+void Properties::overrideRenderPipelineType(RenderPipelineType type, bool inUnitTest) {
// 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) {
- LOG_ALWAYS_FATAL_IF(sRenderPipelineType != type,
- "Trying to change pipeline but it's already set");
- return;
- }
+ // Unit tests can freely change this as often as it wants.
+ LOG_ALWAYS_FATAL_IF(sRenderPipelineType != RenderPipelineType::NotInitialized &&
+ sRenderPipelineType != type && !inUnitTest,
+ "Trying to change pipeline but it's already set.");
sRenderPipelineType = type;
}