diff options
author | 2019-01-31 08:42:23 -0500 | |
---|---|---|
committer | 2019-01-31 10:38:26 -0500 | |
commit | ee3bfe7681d44da520ec646c3e500ccecaaab228 (patch) | |
tree | 344bd055b515b3cddc3a4cb8c085820ea793864d /libs/hwui/HardwareBitmapUploader.cpp | |
parent | 81973983b02c8cd7289b45afa3cc794eae0833a7 (diff) |
Only decode to F16 if HARDWARE supports it
Bug: 123301974
Test: Infeasible
If a Bitmap is going to be decoded to F16 and then converted to
HARDWARE, only decode to F16 if HARDWARE supports it.
Previously, if we discovered after the decode that HARDWARE did not
support F16, we had to copy back to 8888 before the upload.
Change-Id: I3ceb9d053ba134bb96cfb9d638e54ac652e5db29
Diffstat (limited to 'libs/hwui/HardwareBitmapUploader.cpp')
-rw-r--r-- | libs/hwui/HardwareBitmapUploader.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/hwui/HardwareBitmapUploader.cpp b/libs/hwui/HardwareBitmapUploader.cpp index 39bfcdd944a4..6b7ec97de4c8 100644 --- a/libs/hwui/HardwareBitmapUploader.cpp +++ b/libs/hwui/HardwareBitmapUploader.cpp @@ -86,7 +86,7 @@ static EGLDisplay getUploadEglDisplay() { return sEglManager.eglDisplay(); } -static bool hasFP16Support() { +bool HardwareBitmapUploader::hasFP16Support() { static std::once_flag sOnce; static bool hasFP16Support = false; @@ -127,7 +127,7 @@ static FormatInfo determineFormat(const SkBitmap& skBitmap) { formatInfo.type = GL_UNSIGNED_BYTE; break; case kRGBA_F16_SkColorType: - formatInfo.isSupported = hasFP16Support(); + formatInfo.isSupported = HardwareBitmapUploader::hasFP16Support(); if (formatInfo.isSupported) { formatInfo.type = GL_HALF_FLOAT; formatInfo.pixelFormat = PIXEL_FORMAT_RGBA_FP16; |