Loading libs/hwui/Properties.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,8 @@ bool Properties::disableVsync = false; bool Properties::skpCaptureEnabled = false; bool Properties::enableRTAnimations = true; bool Properties::runningInEmulator = false; static int property_get_int(const char* key, int defaultValue) { char buf[PROPERTY_VALUE_MAX] = { '\0', Loading Loading @@ -135,6 +137,8 @@ bool Properties::load() { skpCaptureEnabled = property_get_bool("ro.debuggable", false) && property_get_bool(PROPERTY_CAPTURE_SKP_ENABLED, false); runningInEmulator = property_get_bool(PROPERTY_QEMU_KERNEL, false); return (prevDebugLayersUpdates != debugLayersUpdates) || (prevDebugOverdraw != debugOverdraw) || (prevDebugStencilClip != debugStencilClip); } Loading libs/hwui/Properties.h +7 −0 Original line number Diff line number Diff line Loading @@ -180,6 +180,11 @@ enum DebugLevel { */ #define PROPERTY_CAPTURE_SKP_FILENAME "debug.hwui.skp_filename" /** * Property for whether this is running in the emulator. */ #define PROPERTY_QEMU_KERNEL "ro.kernel.qemu" /////////////////////////////////////////////////////////////////////////////// // Misc /////////////////////////////////////////////////////////////////////////////// Loading Loading @@ -261,6 +266,8 @@ public: // Used for testing only to change the render pipeline. static void overrideRenderPipelineType(RenderPipelineType); static bool runningInEmulator; private: static ProfileType sProfileType; static bool sDisableProfileBars; Loading libs/hwui/pipeline/skia/ShaderCache.cpp +6 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <log/log.h> #include <thread> #include "FileBlobCache.h" #include "Properties.h" #include "utils/TraceUtils.h" namespace android { Loading @@ -43,7 +44,11 @@ ShaderCache& ShaderCache::get() { void ShaderCache::initShaderDiskCache() { ATRACE_NAME("initShaderDiskCache"); std::lock_guard<std::mutex> lock(mMutex); if (mFilename.length() > 0) { // Emulators can switch between different renders either as part of config // or snapshot migration. Also, program binaries may not work well on some // desktop / laptop GPUs. Thus, disable the shader disk cache for emulator builds. if (!Properties::runningInEmulator && mFilename.length() > 0) { mBlobCache.reset(new FileBlobCache(maxKeySize, maxValueSize, maxTotalSize, mFilename)); mInitialized = true; } Loading Loading
libs/hwui/Properties.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,8 @@ bool Properties::disableVsync = false; bool Properties::skpCaptureEnabled = false; bool Properties::enableRTAnimations = true; bool Properties::runningInEmulator = false; static int property_get_int(const char* key, int defaultValue) { char buf[PROPERTY_VALUE_MAX] = { '\0', Loading Loading @@ -135,6 +137,8 @@ bool Properties::load() { skpCaptureEnabled = property_get_bool("ro.debuggable", false) && property_get_bool(PROPERTY_CAPTURE_SKP_ENABLED, false); runningInEmulator = property_get_bool(PROPERTY_QEMU_KERNEL, false); return (prevDebugLayersUpdates != debugLayersUpdates) || (prevDebugOverdraw != debugOverdraw) || (prevDebugStencilClip != debugStencilClip); } Loading
libs/hwui/Properties.h +7 −0 Original line number Diff line number Diff line Loading @@ -180,6 +180,11 @@ enum DebugLevel { */ #define PROPERTY_CAPTURE_SKP_FILENAME "debug.hwui.skp_filename" /** * Property for whether this is running in the emulator. */ #define PROPERTY_QEMU_KERNEL "ro.kernel.qemu" /////////////////////////////////////////////////////////////////////////////// // Misc /////////////////////////////////////////////////////////////////////////////// Loading Loading @@ -261,6 +266,8 @@ public: // Used for testing only to change the render pipeline. static void overrideRenderPipelineType(RenderPipelineType); static bool runningInEmulator; private: static ProfileType sProfileType; static bool sDisableProfileBars; Loading
libs/hwui/pipeline/skia/ShaderCache.cpp +6 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <log/log.h> #include <thread> #include "FileBlobCache.h" #include "Properties.h" #include "utils/TraceUtils.h" namespace android { Loading @@ -43,7 +44,11 @@ ShaderCache& ShaderCache::get() { void ShaderCache::initShaderDiskCache() { ATRACE_NAME("initShaderDiskCache"); std::lock_guard<std::mutex> lock(mMutex); if (mFilename.length() > 0) { // Emulators can switch between different renders either as part of config // or snapshot migration. Also, program binaries may not work well on some // desktop / laptop GPUs. Thus, disable the shader disk cache for emulator builds. if (!Properties::runningInEmulator && mFilename.length() > 0) { mBlobCache.reset(new FileBlobCache(maxKeySize, maxValueSize, maxTotalSize, mFilename)); mInitialized = true; } Loading