Loading libs/ui/DebugUtils.cpp +27 −0 Original line number Original line Diff line number Diff line Loading @@ -234,6 +234,33 @@ std::string decodeColorMode(ColorMode colorMode) { return android::base::StringPrintf("Unknown color mode %d", colorMode); return android::base::StringPrintf("Unknown color mode %d", colorMode); } } std::string decodeColorTransform(android_color_transform colorTransform) { switch (colorTransform) { case HAL_COLOR_TRANSFORM_IDENTITY: return std::string("Identity"); case HAL_COLOR_TRANSFORM_ARBITRARY_MATRIX: return std::string("Arbitrary matrix"); case HAL_COLOR_TRANSFORM_VALUE_INVERSE: return std::string("Inverse value"); case HAL_COLOR_TRANSFORM_GRAYSCALE: return std::string("Grayscale"); case HAL_COLOR_TRANSFORM_CORRECT_PROTANOPIA: return std::string("Correct protanopia"); case HAL_COLOR_TRANSFORM_CORRECT_DEUTERANOPIA: return std::string("Correct deuteranopia"); case HAL_COLOR_TRANSFORM_CORRECT_TRITANOPIA: return std::string("Correct tritanopia"); } return android::base::StringPrintf("Unknown color transform %d", colorTransform); } // Converts a PixelFormat to a human-readable string. Max 11 chars. // Converts a PixelFormat to a human-readable string. Max 11 chars. // (Could use a table of prefab String8 objects.) // (Could use a table of prefab String8 objects.) std::string decodePixelFormat(android::PixelFormat format) { std::string decodePixelFormat(android::PixelFormat format) { Loading libs/ui/include/ui/DebugUtils.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -30,5 +30,6 @@ std::string decodeTransfer(android_dataspace dataspace); std::string decodeRange(android_dataspace dataspace); std::string decodeRange(android_dataspace dataspace); std::string dataspaceDetails(android_dataspace dataspace); std::string dataspaceDetails(android_dataspace dataspace); std::string decodeColorMode(android::ui::ColorMode colormode); std::string decodeColorMode(android::ui::ColorMode colormode); std::string decodeColorTransform(android_color_transform colorTransform); std::string decodePixelFormat(android::PixelFormat format); std::string decodePixelFormat(android::PixelFormat format); std::string to_string(const android::Rect& rect); std::string to_string(const android::Rect& rect); services/surfaceflinger/Android.bp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -105,6 +105,7 @@ filegroup { "Layer.cpp", "Layer.cpp", "LayerProtoHelper.cpp", "LayerProtoHelper.cpp", "LayerRejecter.cpp", "LayerRejecter.cpp", "LayerStats.cpp", "LayerVector.cpp", "LayerVector.cpp", "MessageQueue.cpp", "MessageQueue.cpp", "MonitoredProducer.cpp", "MonitoredProducer.cpp", Loading services/surfaceflinger/DisplayDevice.cpp +11 −0 Original line number Original line Diff line number Diff line Loading @@ -97,6 +97,7 @@ DisplayDevice::DisplayDevice( mPowerMode(initialPowerMode), mPowerMode(initialPowerMode), mActiveConfig(0), mActiveConfig(0), mActiveColorMode(ColorMode::NATIVE), mActiveColorMode(ColorMode::NATIVE), mColorTransform(HAL_COLOR_TRANSFORM_IDENTITY), mDisplayHasWideColor(supportWideColor), mDisplayHasWideColor(supportWideColor), mDisplayHasHdr(supportHdr) mDisplayHasHdr(supportHdr) { { Loading Loading @@ -267,6 +268,16 @@ ColorMode DisplayDevice::getActiveColorMode() const { return mActiveColorMode; return mActiveColorMode; } } void DisplayDevice::setColorTransform(const mat4& transform) { const bool isIdentity = (transform == mat4()); mColorTransform = isIdentity ? HAL_COLOR_TRANSFORM_IDENTITY : HAL_COLOR_TRANSFORM_ARBITRARY_MATRIX; } android_color_transform_t DisplayDevice::getColorTransform() const { return mColorTransform; } void DisplayDevice::setCompositionDataSpace(android_dataspace dataspace) { void DisplayDevice::setCompositionDataSpace(android_dataspace dataspace) { ANativeWindow* const window = mNativeWindow.get(); ANativeWindow* const window = mNativeWindow.get(); native_window_set_buffers_data_space(window, dataspace); native_window_set_buffers_data_space(window, dataspace); Loading services/surfaceflinger/DisplayDevice.h +6 −0 Original line number Original line Diff line number Diff line Loading @@ -21,6 +21,8 @@ #include <stdlib.h> #include <stdlib.h> #include <math/mat4.h> #include <ui/Region.h> #include <ui/Region.h> #include <binder/IBinder.h> #include <binder/IBinder.h> Loading Loading @@ -163,6 +165,8 @@ public: ui::ColorMode getActiveColorMode() const; ui::ColorMode getActiveColorMode() const; void setActiveColorMode(ui::ColorMode mode); void setActiveColorMode(ui::ColorMode mode); android_color_transform_t getColorTransform() const; void setColorTransform(const mat4& transform); void setCompositionDataSpace(android_dataspace dataspace); void setCompositionDataSpace(android_dataspace dataspace); /* ------------------------------------------------------------------------ /* ------------------------------------------------------------------------ Loading Loading @@ -237,6 +241,8 @@ private: int mActiveConfig; int mActiveConfig; // current active color mode // current active color mode ui::ColorMode mActiveColorMode; ui::ColorMode mActiveColorMode; // Current color transform android_color_transform_t mColorTransform; // Need to know if display is wide-color capable or not. // Need to know if display is wide-color capable or not. // Initialized by SurfaceFlinger when the DisplayDevice is created. // Initialized by SurfaceFlinger when the DisplayDevice is created. Loading Loading
libs/ui/DebugUtils.cpp +27 −0 Original line number Original line Diff line number Diff line Loading @@ -234,6 +234,33 @@ std::string decodeColorMode(ColorMode colorMode) { return android::base::StringPrintf("Unknown color mode %d", colorMode); return android::base::StringPrintf("Unknown color mode %d", colorMode); } } std::string decodeColorTransform(android_color_transform colorTransform) { switch (colorTransform) { case HAL_COLOR_TRANSFORM_IDENTITY: return std::string("Identity"); case HAL_COLOR_TRANSFORM_ARBITRARY_MATRIX: return std::string("Arbitrary matrix"); case HAL_COLOR_TRANSFORM_VALUE_INVERSE: return std::string("Inverse value"); case HAL_COLOR_TRANSFORM_GRAYSCALE: return std::string("Grayscale"); case HAL_COLOR_TRANSFORM_CORRECT_PROTANOPIA: return std::string("Correct protanopia"); case HAL_COLOR_TRANSFORM_CORRECT_DEUTERANOPIA: return std::string("Correct deuteranopia"); case HAL_COLOR_TRANSFORM_CORRECT_TRITANOPIA: return std::string("Correct tritanopia"); } return android::base::StringPrintf("Unknown color transform %d", colorTransform); } // Converts a PixelFormat to a human-readable string. Max 11 chars. // Converts a PixelFormat to a human-readable string. Max 11 chars. // (Could use a table of prefab String8 objects.) // (Could use a table of prefab String8 objects.) std::string decodePixelFormat(android::PixelFormat format) { std::string decodePixelFormat(android::PixelFormat format) { Loading
libs/ui/include/ui/DebugUtils.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -30,5 +30,6 @@ std::string decodeTransfer(android_dataspace dataspace); std::string decodeRange(android_dataspace dataspace); std::string decodeRange(android_dataspace dataspace); std::string dataspaceDetails(android_dataspace dataspace); std::string dataspaceDetails(android_dataspace dataspace); std::string decodeColorMode(android::ui::ColorMode colormode); std::string decodeColorMode(android::ui::ColorMode colormode); std::string decodeColorTransform(android_color_transform colorTransform); std::string decodePixelFormat(android::PixelFormat format); std::string decodePixelFormat(android::PixelFormat format); std::string to_string(const android::Rect& rect); std::string to_string(const android::Rect& rect);
services/surfaceflinger/Android.bp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -105,6 +105,7 @@ filegroup { "Layer.cpp", "Layer.cpp", "LayerProtoHelper.cpp", "LayerProtoHelper.cpp", "LayerRejecter.cpp", "LayerRejecter.cpp", "LayerStats.cpp", "LayerVector.cpp", "LayerVector.cpp", "MessageQueue.cpp", "MessageQueue.cpp", "MonitoredProducer.cpp", "MonitoredProducer.cpp", Loading
services/surfaceflinger/DisplayDevice.cpp +11 −0 Original line number Original line Diff line number Diff line Loading @@ -97,6 +97,7 @@ DisplayDevice::DisplayDevice( mPowerMode(initialPowerMode), mPowerMode(initialPowerMode), mActiveConfig(0), mActiveConfig(0), mActiveColorMode(ColorMode::NATIVE), mActiveColorMode(ColorMode::NATIVE), mColorTransform(HAL_COLOR_TRANSFORM_IDENTITY), mDisplayHasWideColor(supportWideColor), mDisplayHasWideColor(supportWideColor), mDisplayHasHdr(supportHdr) mDisplayHasHdr(supportHdr) { { Loading Loading @@ -267,6 +268,16 @@ ColorMode DisplayDevice::getActiveColorMode() const { return mActiveColorMode; return mActiveColorMode; } } void DisplayDevice::setColorTransform(const mat4& transform) { const bool isIdentity = (transform == mat4()); mColorTransform = isIdentity ? HAL_COLOR_TRANSFORM_IDENTITY : HAL_COLOR_TRANSFORM_ARBITRARY_MATRIX; } android_color_transform_t DisplayDevice::getColorTransform() const { return mColorTransform; } void DisplayDevice::setCompositionDataSpace(android_dataspace dataspace) { void DisplayDevice::setCompositionDataSpace(android_dataspace dataspace) { ANativeWindow* const window = mNativeWindow.get(); ANativeWindow* const window = mNativeWindow.get(); native_window_set_buffers_data_space(window, dataspace); native_window_set_buffers_data_space(window, dataspace); Loading
services/surfaceflinger/DisplayDevice.h +6 −0 Original line number Original line Diff line number Diff line Loading @@ -21,6 +21,8 @@ #include <stdlib.h> #include <stdlib.h> #include <math/mat4.h> #include <ui/Region.h> #include <ui/Region.h> #include <binder/IBinder.h> #include <binder/IBinder.h> Loading Loading @@ -163,6 +165,8 @@ public: ui::ColorMode getActiveColorMode() const; ui::ColorMode getActiveColorMode() const; void setActiveColorMode(ui::ColorMode mode); void setActiveColorMode(ui::ColorMode mode); android_color_transform_t getColorTransform() const; void setColorTransform(const mat4& transform); void setCompositionDataSpace(android_dataspace dataspace); void setCompositionDataSpace(android_dataspace dataspace); /* ------------------------------------------------------------------------ /* ------------------------------------------------------------------------ Loading Loading @@ -237,6 +241,8 @@ private: int mActiveConfig; int mActiveConfig; // current active color mode // current active color mode ui::ColorMode mActiveColorMode; ui::ColorMode mActiveColorMode; // Current color transform android_color_transform_t mColorTransform; // Need to know if display is wide-color capable or not. // Need to know if display is wide-color capable or not. // Initialized by SurfaceFlinger when the DisplayDevice is created. // Initialized by SurfaceFlinger when the DisplayDevice is created. Loading