Loading libs/ui/PixelFormat.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ uint32_t bytesPerPixel(PixelFormat format) { case PIXEL_FORMAT_RGBX_8888: case PIXEL_FORMAT_BGRA_8888: case PIXEL_FORMAT_RGBA_1010102: case PIXEL_FORMAT_BGRA_1010102: return 4; case PIXEL_FORMAT_RGB_888: return 3; Loading @@ -38,9 +39,12 @@ uint32_t bytesPerPixel(PixelFormat format) { case PIXEL_FORMAT_R_8: return 1; } return 0; } // ---------------------------------------------------------------------------- }; // namespace android // ---------------------------------------------------------------------------- libs/ui/include/ui/PixelFormat.h +2 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,8 @@ enum { PIXEL_FORMAT_R_16_UINT = 0x39, PIXEL_FORMAT_RG_1616_UINT = 0x3a, PIXEL_FORMAT_RGBA_10101010 = 0x3b, // we really need to kill this off >_> PIXEL_FORMAT_BGRA_1010102 = 0x43, }; typedef int32_t PixelFormat; Loading services/surfaceflinger/SurfaceFlinger.cpp +12 −6 Original line number Diff line number Diff line Loading @@ -7782,6 +7782,11 @@ SurfaceFlinger::setScreenshotSnapshotsAndDisplayState(ScreenshotArgs& args) { attributes.format), 1 /* layerCount */, usage, "screenshot"); if (const auto status = readbackBuffer->initCheck(); status != OK) { ALOGE("Failed to allocate readback buffer :(: %d", status); return base::unexpected<status_t>(INVALID_OPERATION); } else { mReadbackRequests.emplace_back(*asPhysicalDisplayId(displayId), readbackBuffer, args.captureListener, args.preserveDisplayColors, Loading @@ -7791,6 +7796,7 @@ SurfaceFlinger::setScreenshotSnapshotsAndDisplayState(ScreenshotArgs& args) { } } } } // Non-threaded RenderEngine eventually returns to the main thread a 2nd time // to complete the screenshot. Release fences should only be added during the 2nd Loading Loading
libs/ui/PixelFormat.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ uint32_t bytesPerPixel(PixelFormat format) { case PIXEL_FORMAT_RGBX_8888: case PIXEL_FORMAT_BGRA_8888: case PIXEL_FORMAT_RGBA_1010102: case PIXEL_FORMAT_BGRA_1010102: return 4; case PIXEL_FORMAT_RGB_888: return 3; Loading @@ -38,9 +39,12 @@ uint32_t bytesPerPixel(PixelFormat format) { case PIXEL_FORMAT_R_8: return 1; } return 0; } // ---------------------------------------------------------------------------- }; // namespace android // ----------------------------------------------------------------------------
libs/ui/include/ui/PixelFormat.h +2 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,8 @@ enum { PIXEL_FORMAT_R_16_UINT = 0x39, PIXEL_FORMAT_RG_1616_UINT = 0x3a, PIXEL_FORMAT_RGBA_10101010 = 0x3b, // we really need to kill this off >_> PIXEL_FORMAT_BGRA_1010102 = 0x43, }; typedef int32_t PixelFormat; Loading
services/surfaceflinger/SurfaceFlinger.cpp +12 −6 Original line number Diff line number Diff line Loading @@ -7782,6 +7782,11 @@ SurfaceFlinger::setScreenshotSnapshotsAndDisplayState(ScreenshotArgs& args) { attributes.format), 1 /* layerCount */, usage, "screenshot"); if (const auto status = readbackBuffer->initCheck(); status != OK) { ALOGE("Failed to allocate readback buffer :(: %d", status); return base::unexpected<status_t>(INVALID_OPERATION); } else { mReadbackRequests.emplace_back(*asPhysicalDisplayId(displayId), readbackBuffer, args.captureListener, args.preserveDisplayColors, Loading @@ -7791,6 +7796,7 @@ SurfaceFlinger::setScreenshotSnapshotsAndDisplayState(ScreenshotArgs& args) { } } } } // Non-threaded RenderEngine eventually returns to the main thread a 2nd time // to complete the screenshot. Release fences should only be added during the 2nd Loading