Loading libs/hwui/Properties.cpp +5 −8 Original line number Diff line number Diff line Loading @@ -17,8 +17,8 @@ #include "Properties.h" #include "Debug.h" #include "DeviceInfo.h" #include "SkTraceEventCommon.h" #include "HWUIProperties.sysprop.h" #include "SkTraceEventCommon.h" #include <algorithm> #include <cstdlib> Loading Loading @@ -67,7 +67,7 @@ bool Properties::debuggingEnabled = false; bool Properties::isolatedProcess = false; int Properties::contextPriority = 0; int Properties::defaultRenderAhead = 0; uint32_t Properties::defaultRenderAhead = 0; static int property_get_int(const char* key, int defaultValue) { char buf[PROPERTY_VALUE_MAX] = { Loading Loading @@ -130,12 +130,9 @@ bool Properties::load() { enableForceDarkSupport = property_get_bool(PROPERTY_ENABLE_FORCE_DARK, true); defaultRenderAhead = std::max(0, std::min(2, property_get_int(PROPERTY_RENDERAHEAD, render_ahead().value_or(0)))); if (defaultRenderAhead && sRenderPipelineType == RenderPipelineType::SkiaVulkan) { ALOGW("hwui.render_ahead of %d ignored because pipeline is skiavk", defaultRenderAhead); } defaultRenderAhead = std::max(0u, std::min(2u, static_cast<uint32_t>(property_get_int( PROPERTY_RENDERAHEAD, render_ahead().value_or(0))))); return (prevDebugLayersUpdates != debugLayersUpdates) || (prevDebugOverdraw != debugOverdraw); } Loading libs/hwui/Properties.h +1 −1 Original line number Diff line number Diff line Loading @@ -253,7 +253,7 @@ public: ANDROID_API static int contextPriority; static int defaultRenderAhead; static uint32_t defaultRenderAhead; private: static ProfileType sProfileType; Loading libs/hwui/pipeline/skia/ShaderCache.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ #include "ShaderCache.h" #include <GrContext.h> #include <log/log.h> #include <openssl/sha.h> #include <algorithm> Loading @@ -23,7 +24,6 @@ #include "FileBlobCache.h" #include "Properties.h" #include "utils/TraceUtils.h" #include <GrContext.h> namespace android { namespace uirenderer { Loading libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp +18 −2 Original line number Diff line number Diff line Loading @@ -156,8 +156,23 @@ void SkiaOpenGLPipeline::onStop() { } } static void setBufferCount(ANativeWindow* window, uint32_t extraBuffers) { int query_value; int err = window->query(window, NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS, &query_value); if (err != 0 || query_value < 0) { ALOGE("window->query failed: %s (%d) value=%d", strerror(-err), err, query_value); return; } auto min_undequeued_buffers = static_cast<uint32_t>(query_value); int bufferCount = min_undequeued_buffers + 2 + extraBuffers; ALOGD("Setting buffer count to %d, min_undequeued %u, extraBuffers %u", bufferCount, min_undequeued_buffers, extraBuffers); native_window_set_buffer_count(window, bufferCount); } bool SkiaOpenGLPipeline::setSurface(ANativeWindow* surface, SwapBehavior swapBehavior, ColorMode colorMode) { ColorMode colorMode, uint32_t extraBuffers) { if (mEglSurface != EGL_NO_SURFACE) { mEglManager.destroySurface(mEglSurface); mEglSurface = EGL_NO_SURFACE; Loading @@ -177,6 +192,7 @@ bool SkiaOpenGLPipeline::setSurface(ANativeWindow* surface, SwapBehavior swapBeh if (mEglSurface != EGL_NO_SURFACE) { const bool preserveBuffer = (swapBehavior != SwapBehavior::kSwap_discardBuffer); mBufferPreserved = mEglManager.setPreserveBuffer(mEglSurface, preserveBuffer); setBufferCount(surface, extraBuffers); return true; } Loading libs/hwui/pipeline/skia/SkiaOpenGLPipeline.h +1 −1 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ public: FrameInfo* currentFrameInfo, bool* requireSwap) override; DeferredLayerUpdater* createTextureLayer() override; bool setSurface(ANativeWindow* surface, renderthread::SwapBehavior swapBehavior, renderthread::ColorMode colorMode) override; renderthread::ColorMode colorMode, uint32_t extraBuffers) override; void onStop() override; bool isSurfaceReady() override; bool isContextReady() override; Loading Loading
libs/hwui/Properties.cpp +5 −8 Original line number Diff line number Diff line Loading @@ -17,8 +17,8 @@ #include "Properties.h" #include "Debug.h" #include "DeviceInfo.h" #include "SkTraceEventCommon.h" #include "HWUIProperties.sysprop.h" #include "SkTraceEventCommon.h" #include <algorithm> #include <cstdlib> Loading Loading @@ -67,7 +67,7 @@ bool Properties::debuggingEnabled = false; bool Properties::isolatedProcess = false; int Properties::contextPriority = 0; int Properties::defaultRenderAhead = 0; uint32_t Properties::defaultRenderAhead = 0; static int property_get_int(const char* key, int defaultValue) { char buf[PROPERTY_VALUE_MAX] = { Loading Loading @@ -130,12 +130,9 @@ bool Properties::load() { enableForceDarkSupport = property_get_bool(PROPERTY_ENABLE_FORCE_DARK, true); defaultRenderAhead = std::max(0, std::min(2, property_get_int(PROPERTY_RENDERAHEAD, render_ahead().value_or(0)))); if (defaultRenderAhead && sRenderPipelineType == RenderPipelineType::SkiaVulkan) { ALOGW("hwui.render_ahead of %d ignored because pipeline is skiavk", defaultRenderAhead); } defaultRenderAhead = std::max(0u, std::min(2u, static_cast<uint32_t>(property_get_int( PROPERTY_RENDERAHEAD, render_ahead().value_or(0))))); return (prevDebugLayersUpdates != debugLayersUpdates) || (prevDebugOverdraw != debugOverdraw); } Loading
libs/hwui/Properties.h +1 −1 Original line number Diff line number Diff line Loading @@ -253,7 +253,7 @@ public: ANDROID_API static int contextPriority; static int defaultRenderAhead; static uint32_t defaultRenderAhead; private: static ProfileType sProfileType; Loading
libs/hwui/pipeline/skia/ShaderCache.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ #include "ShaderCache.h" #include <GrContext.h> #include <log/log.h> #include <openssl/sha.h> #include <algorithm> Loading @@ -23,7 +24,6 @@ #include "FileBlobCache.h" #include "Properties.h" #include "utils/TraceUtils.h" #include <GrContext.h> namespace android { namespace uirenderer { Loading
libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp +18 −2 Original line number Diff line number Diff line Loading @@ -156,8 +156,23 @@ void SkiaOpenGLPipeline::onStop() { } } static void setBufferCount(ANativeWindow* window, uint32_t extraBuffers) { int query_value; int err = window->query(window, NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS, &query_value); if (err != 0 || query_value < 0) { ALOGE("window->query failed: %s (%d) value=%d", strerror(-err), err, query_value); return; } auto min_undequeued_buffers = static_cast<uint32_t>(query_value); int bufferCount = min_undequeued_buffers + 2 + extraBuffers; ALOGD("Setting buffer count to %d, min_undequeued %u, extraBuffers %u", bufferCount, min_undequeued_buffers, extraBuffers); native_window_set_buffer_count(window, bufferCount); } bool SkiaOpenGLPipeline::setSurface(ANativeWindow* surface, SwapBehavior swapBehavior, ColorMode colorMode) { ColorMode colorMode, uint32_t extraBuffers) { if (mEglSurface != EGL_NO_SURFACE) { mEglManager.destroySurface(mEglSurface); mEglSurface = EGL_NO_SURFACE; Loading @@ -177,6 +192,7 @@ bool SkiaOpenGLPipeline::setSurface(ANativeWindow* surface, SwapBehavior swapBeh if (mEglSurface != EGL_NO_SURFACE) { const bool preserveBuffer = (swapBehavior != SwapBehavior::kSwap_discardBuffer); mBufferPreserved = mEglManager.setPreserveBuffer(mEglSurface, preserveBuffer); setBufferCount(surface, extraBuffers); return true; } Loading
libs/hwui/pipeline/skia/SkiaOpenGLPipeline.h +1 −1 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ public: FrameInfo* currentFrameInfo, bool* requireSwap) override; DeferredLayerUpdater* createTextureLayer() override; bool setSurface(ANativeWindow* surface, renderthread::SwapBehavior swapBehavior, renderthread::ColorMode colorMode) override; renderthread::ColorMode colorMode, uint32_t extraBuffers) override; void onStop() override; bool isSurfaceReady() override; bool isContextReady() override; Loading