diff options
| author | 2019-06-20 03:12:39 +0000 | |
|---|---|---|
| committer | 2019-06-20 03:12:39 +0000 | |
| commit | 5531408797caca34a22d7f9c0b787fcf7ad8d67d (patch) | |
| tree | d5724150f6aab4b3ae47f72161ac57ec5c2e2556 | |
| parent | b9fb4afe9cab7b4c958767d3d510d3304a6d99f0 (diff) | |
| parent | 6c54549fbf2cc372d8bb002c5236244e733a57f6 (diff) | |
Snap for 5674532 from 6c54549fbf2cc372d8bb002c5236244e733a57f6 to qt-c2f2-release
Change-Id: I73e0f3436e89e01d074fdd56e8f73efd5ddffbf8
| -rw-r--r-- | libs/dumputils/dump_utils.cpp | 1 | ||||
| -rw-r--r-- | services/surfaceflinger/RegionSamplingThread.cpp | 10 |
2 files changed, 6 insertions, 5 deletions
diff --git a/libs/dumputils/dump_utils.cpp b/libs/dumputils/dump_utils.cpp index 40f6b43802..8e762f193f 100644 --- a/libs/dumputils/dump_utils.cpp +++ b/libs/dumputils/dump_utils.cpp @@ -46,6 +46,7 @@ static const char* native_processes_to_dump[] = { static const char* hal_interfaces_to_dump[] { "android.hardware.audio@2.0::IDevicesFactory", "android.hardware.audio@4.0::IDevicesFactory", + "android.hardware.biometrics.face@1.0::IBiometricsFace", "android.hardware.bluetooth@1.0::IBluetoothHci", "android.hardware.camera.provider@2.4::ICameraProvider", "android.hardware.drm@1.0::IDrmFactory", diff --git a/services/surfaceflinger/RegionSamplingThread.cpp b/services/surfaceflinger/RegionSamplingThread.cpp index 66906e950c..8b85d4cdbf 100644 --- a/services/surfaceflinger/RegionSamplingThread.cpp +++ b/services/surfaceflinger/RegionSamplingThread.cpp @@ -258,7 +258,7 @@ void RegionSamplingThread::binderDied(const wp<IBinder>& who) { namespace { // Using Rec. 709 primaries -float getLuma(float r, float g, float b) { +inline float getLuma(float r, float g, float b) { constexpr auto rec709_red_primary = 0.2126f; constexpr auto rec709_green_primary = 0.7152f; constexpr auto rec709_blue_primary = 0.0722f; @@ -293,10 +293,10 @@ float sampleArea(const uint32_t* data, int32_t width, int32_t height, int32_t st const uint32_t* rowBase = data + row * stride; for (int32_t column = area.left; column < area.right; ++column) { uint32_t pixel = rowBase[column]; - const float r = (pixel & 0xFF) / 255.0f; - const float g = ((pixel >> 8) & 0xFF) / 255.0f; - const float b = ((pixel >> 16) & 0xFF) / 255.0f; - const uint8_t luma = std::round(getLuma(r, g, b) * 255.0f); + const float r = pixel & 0xFF; + const float g = (pixel >> 8) & 0xFF; + const float b = (pixel >> 16) & 0xFF; + const uint8_t luma = std::round(getLuma(r, g, b)); ++brightnessBuckets[luma]; if (brightnessBuckets[luma] > majoritySampleNum) return luma / 255.0f; } |