Loading graphics/java/android/graphics/HardwareRenderer.java +3 −15 Original line number Diff line number Diff line Loading @@ -46,7 +46,6 @@ import java.io.File; import java.io.FileDescriptor; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.util.Arrays; import java.util.Optional; import java.util.concurrent.Executor; import java.util.stream.Stream; Loading Loading @@ -1148,24 +1147,14 @@ public class HardwareRenderer { // Default to SRGB if the display doesn't support wide color .orElse(Dataspace.SRGB); float maxRefreshRate = (float) Arrays.stream(display.getSupportedModes()) .mapToDouble(Mode::getRefreshRate) .max() .orElseGet(() -> { Log.i(LOG_TAG, "Failed to find the maximum display refresh rate"); // Assume that the max refresh rate is 60hz if we can't find one. return 60.0; }); // Grab the physical screen dimensions from the active display mode // Strictly speaking the screen resolution may not always be constant - it is for // sizing the font cache for the underlying rendering thread. Since it's a // heuristic we don't need to be always 100% correct. Mode activeMode = display.getMode(); nInitDisplayInfo(activeMode.getPhysicalWidth(), activeMode.getPhysicalHeight(), display.getRefreshRate(), maxRefreshRate, wideColorDataspace.mNativeDataspace, display.getAppVsyncOffsetNanos(), display.getPresentationDeadlineNanos()); display.getRefreshRate(), wideColorDataspace.mNativeDataspace, display.getAppVsyncOffsetNanos(), display.getPresentationDeadlineNanos()); // Defensively clear out the context mContext = null; Loading Loading @@ -1324,6 +1313,5 @@ public class HardwareRenderer { private static native void nSetDisplayDensityDpi(int densityDpi); private static native void nInitDisplayInfo(int width, int height, float refreshRate, float maxRefreshRate, int wideColorDataspace, long appVsyncOffsetNanos, long presentationDeadlineNanos); int wideColorDataspace, long appVsyncOffsetNanos, long presentationDeadlineNanos); } libs/hwui/DeviceInfo.h +0 −3 Original line number Diff line number Diff line Loading @@ -35,7 +35,6 @@ class DeviceInfo { public: static DeviceInfo* get(); static float getMaxRefreshRate() { return get()->mMaxRefreshRate; } static int32_t getWidth() { return get()->mWidth; } static int32_t getHeight() { return get()->mHeight; } // Gets the density in density-independent pixels Loading @@ -45,7 +44,6 @@ public: static int64_t getAppOffset() { return get()->mAppVsyncOffsetNanos; } // Sets the density in density-independent pixels static void setDensity(float density) { sDensity.store(density); } static void setMaxRefreshRate(float refreshRate) { get()->mMaxRefreshRate = refreshRate; } static void setWidth(int32_t width) { get()->mWidth = width; } static void setHeight(int32_t height) { get()->mHeight = height; } static void setRefreshRate(float refreshRate) { Loading Loading @@ -91,7 +89,6 @@ private: SkColorType mWideColorType = SkColorType::kN32_SkColorType; int mDisplaysSize = 0; int mPhysicalDisplayIndex = -1; float mMaxRefreshRate = 60.0; int32_t mWidth = 1080; int32_t mHeight = 1920; int64_t mVsyncPeriod = 16666666; Loading libs/hwui/Properties.cpp +0 −5 Original line number Diff line number Diff line Loading @@ -79,7 +79,6 @@ bool Properties::debuggingEnabled = false; bool Properties::isolatedProcess = false; int Properties::contextPriority = 0; int Properties::defaultRenderAhead = -1; float Properties::defaultSdrWhitePoint = 200.f; bool Properties::load() { Loading Loading @@ -129,10 +128,6 @@ bool Properties::load() { runningInEmulator = base::GetBoolProperty(PROPERTY_QEMU_KERNEL, false); defaultRenderAhead = std::max( -1, std::min(2, base::GetIntProperty(PROPERTY_RENDERAHEAD, render_ahead().value_or(-1)))); return (prevDebugLayersUpdates != debugLayersUpdates) || (prevDebugOverdraw != debugOverdraw); } Loading libs/hwui/Properties.h +0 −4 Original line number Diff line number Diff line Loading @@ -162,8 +162,6 @@ enum DebugLevel { */ #define PROPERTY_QEMU_KERNEL "ro.kernel.qemu" #define PROPERTY_RENDERAHEAD "debug.hwui.render_ahead" /////////////////////////////////////////////////////////////////////////////// // Misc /////////////////////////////////////////////////////////////////////////////// Loading Loading @@ -247,8 +245,6 @@ public: static int contextPriority; static int defaultRenderAhead; static float defaultSdrWhitePoint; private: Loading libs/hwui/jni/android_graphics_HardwareRenderer.cpp +1 −3 Original line number Diff line number Diff line Loading @@ -603,14 +603,12 @@ static void android_view_ThreadedRenderer_setDisplayDensityDpi(JNIEnv*, jclass, static void android_view_ThreadedRenderer_initDisplayInfo(JNIEnv*, jclass, jint physicalWidth, jint physicalHeight, jfloat refreshRate, jfloat maxRefreshRate, jint wideColorDataspace, jlong appVsyncOffsetNanos, jlong presentationDeadlineNanos) { DeviceInfo::setWidth(physicalWidth); DeviceInfo::setHeight(physicalHeight); DeviceInfo::setRefreshRate(refreshRate); DeviceInfo::setMaxRefreshRate(maxRefreshRate); DeviceInfo::setWideColorDataspace(static_cast<ADataSpace>(wideColorDataspace)); DeviceInfo::setAppVsyncOffsetNanos(appVsyncOffsetNanos); DeviceInfo::setPresentationDeadlineNanos(presentationDeadlineNanos); Loading Loading @@ -735,7 +733,7 @@ static const JNINativeMethod gMethods[] = { {"nSetForceDark", "(JZ)V", (void*)android_view_ThreadedRenderer_setForceDark}, {"nSetDisplayDensityDpi", "(I)V", (void*)android_view_ThreadedRenderer_setDisplayDensityDpi}, {"nInitDisplayInfo", "(IIFFIJJ)V", (void*)android_view_ThreadedRenderer_initDisplayInfo}, {"nInitDisplayInfo", "(IIFIJJ)V", (void*)android_view_ThreadedRenderer_initDisplayInfo}, {"preload", "()V", (void*)android_view_ThreadedRenderer_preload}, }; Loading Loading
graphics/java/android/graphics/HardwareRenderer.java +3 −15 Original line number Diff line number Diff line Loading @@ -46,7 +46,6 @@ import java.io.File; import java.io.FileDescriptor; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.util.Arrays; import java.util.Optional; import java.util.concurrent.Executor; import java.util.stream.Stream; Loading Loading @@ -1148,24 +1147,14 @@ public class HardwareRenderer { // Default to SRGB if the display doesn't support wide color .orElse(Dataspace.SRGB); float maxRefreshRate = (float) Arrays.stream(display.getSupportedModes()) .mapToDouble(Mode::getRefreshRate) .max() .orElseGet(() -> { Log.i(LOG_TAG, "Failed to find the maximum display refresh rate"); // Assume that the max refresh rate is 60hz if we can't find one. return 60.0; }); // Grab the physical screen dimensions from the active display mode // Strictly speaking the screen resolution may not always be constant - it is for // sizing the font cache for the underlying rendering thread. Since it's a // heuristic we don't need to be always 100% correct. Mode activeMode = display.getMode(); nInitDisplayInfo(activeMode.getPhysicalWidth(), activeMode.getPhysicalHeight(), display.getRefreshRate(), maxRefreshRate, wideColorDataspace.mNativeDataspace, display.getAppVsyncOffsetNanos(), display.getPresentationDeadlineNanos()); display.getRefreshRate(), wideColorDataspace.mNativeDataspace, display.getAppVsyncOffsetNanos(), display.getPresentationDeadlineNanos()); // Defensively clear out the context mContext = null; Loading Loading @@ -1324,6 +1313,5 @@ public class HardwareRenderer { private static native void nSetDisplayDensityDpi(int densityDpi); private static native void nInitDisplayInfo(int width, int height, float refreshRate, float maxRefreshRate, int wideColorDataspace, long appVsyncOffsetNanos, long presentationDeadlineNanos); int wideColorDataspace, long appVsyncOffsetNanos, long presentationDeadlineNanos); }
libs/hwui/DeviceInfo.h +0 −3 Original line number Diff line number Diff line Loading @@ -35,7 +35,6 @@ class DeviceInfo { public: static DeviceInfo* get(); static float getMaxRefreshRate() { return get()->mMaxRefreshRate; } static int32_t getWidth() { return get()->mWidth; } static int32_t getHeight() { return get()->mHeight; } // Gets the density in density-independent pixels Loading @@ -45,7 +44,6 @@ public: static int64_t getAppOffset() { return get()->mAppVsyncOffsetNanos; } // Sets the density in density-independent pixels static void setDensity(float density) { sDensity.store(density); } static void setMaxRefreshRate(float refreshRate) { get()->mMaxRefreshRate = refreshRate; } static void setWidth(int32_t width) { get()->mWidth = width; } static void setHeight(int32_t height) { get()->mHeight = height; } static void setRefreshRate(float refreshRate) { Loading Loading @@ -91,7 +89,6 @@ private: SkColorType mWideColorType = SkColorType::kN32_SkColorType; int mDisplaysSize = 0; int mPhysicalDisplayIndex = -1; float mMaxRefreshRate = 60.0; int32_t mWidth = 1080; int32_t mHeight = 1920; int64_t mVsyncPeriod = 16666666; Loading
libs/hwui/Properties.cpp +0 −5 Original line number Diff line number Diff line Loading @@ -79,7 +79,6 @@ bool Properties::debuggingEnabled = false; bool Properties::isolatedProcess = false; int Properties::contextPriority = 0; int Properties::defaultRenderAhead = -1; float Properties::defaultSdrWhitePoint = 200.f; bool Properties::load() { Loading Loading @@ -129,10 +128,6 @@ bool Properties::load() { runningInEmulator = base::GetBoolProperty(PROPERTY_QEMU_KERNEL, false); defaultRenderAhead = std::max( -1, std::min(2, base::GetIntProperty(PROPERTY_RENDERAHEAD, render_ahead().value_or(-1)))); return (prevDebugLayersUpdates != debugLayersUpdates) || (prevDebugOverdraw != debugOverdraw); } Loading
libs/hwui/Properties.h +0 −4 Original line number Diff line number Diff line Loading @@ -162,8 +162,6 @@ enum DebugLevel { */ #define PROPERTY_QEMU_KERNEL "ro.kernel.qemu" #define PROPERTY_RENDERAHEAD "debug.hwui.render_ahead" /////////////////////////////////////////////////////////////////////////////// // Misc /////////////////////////////////////////////////////////////////////////////// Loading Loading @@ -247,8 +245,6 @@ public: static int contextPriority; static int defaultRenderAhead; static float defaultSdrWhitePoint; private: Loading
libs/hwui/jni/android_graphics_HardwareRenderer.cpp +1 −3 Original line number Diff line number Diff line Loading @@ -603,14 +603,12 @@ static void android_view_ThreadedRenderer_setDisplayDensityDpi(JNIEnv*, jclass, static void android_view_ThreadedRenderer_initDisplayInfo(JNIEnv*, jclass, jint physicalWidth, jint physicalHeight, jfloat refreshRate, jfloat maxRefreshRate, jint wideColorDataspace, jlong appVsyncOffsetNanos, jlong presentationDeadlineNanos) { DeviceInfo::setWidth(physicalWidth); DeviceInfo::setHeight(physicalHeight); DeviceInfo::setRefreshRate(refreshRate); DeviceInfo::setMaxRefreshRate(maxRefreshRate); DeviceInfo::setWideColorDataspace(static_cast<ADataSpace>(wideColorDataspace)); DeviceInfo::setAppVsyncOffsetNanos(appVsyncOffsetNanos); DeviceInfo::setPresentationDeadlineNanos(presentationDeadlineNanos); Loading Loading @@ -735,7 +733,7 @@ static const JNINativeMethod gMethods[] = { {"nSetForceDark", "(JZ)V", (void*)android_view_ThreadedRenderer_setForceDark}, {"nSetDisplayDensityDpi", "(I)V", (void*)android_view_ThreadedRenderer_setDisplayDensityDpi}, {"nInitDisplayInfo", "(IIFFIJJ)V", (void*)android_view_ThreadedRenderer_initDisplayInfo}, {"nInitDisplayInfo", "(IIFIJJ)V", (void*)android_view_ThreadedRenderer_initDisplayInfo}, {"preload", "()V", (void*)android_view_ThreadedRenderer_preload}, }; Loading