From efcbd6dfd14077f38341356519381269105b014a Mon Sep 17 00:00:00 2001 From: Derek Sollenberger Date: Fri, 19 Mar 2021 12:10:28 -0400 Subject: [PATCH] Remove and update code that was addressing old SwiftShader workarounds. Bug: 183203135 Test: CtsUiRenderingTestCases w/ SwiftShader Change-Id: Ib61902d0e6cea691367bf1d9a4a0877ca0e60a91 --- libs/hwui/Readback.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/libs/hwui/Readback.cpp b/libs/hwui/Readback.cpp index b71bb07dbc867..145526996678c 100644 --- a/libs/hwui/Readback.cpp +++ b/libs/hwui/Readback.cpp @@ -120,12 +120,6 @@ CopyResult Readback::copyImageInto(const sk_sp& image, Matrix4& texTran int imgHeight = image->height(); sk_sp grContext = sk_ref_sp(mRenderThread.getGrContext()); - if (bitmap->colorType() == kRGBA_F16_SkColorType && - !grContext->colorTypeSupportedAsSurface(bitmap->colorType())) { - ALOGW("Can't copy surface into bitmap, RGBA_F16 config is not supported"); - return CopyResult::DestinationInvalid; - } - CopyResult copyResult = CopyResult::UnknownError; int displayedWidth = imgWidth, displayedHeight = imgHeight; @@ -159,12 +153,10 @@ CopyResult Readback::copyImageInto(const sk_sp& image, Matrix4& texTran bool Readback::copyLayerInto(Layer* layer, const SkRect* srcRect, const SkRect* dstRect, SkBitmap* bitmap) { - /* This intermediate surface is present to work around a bug in SwiftShader that - * prevents us from reading the contents of the layer's texture directly. The - * workaround involves first rendering that texture into an intermediate buffer and - * then reading from the intermediate buffer into the bitmap. - * Another reason to render in an offscreen buffer is to scale and to avoid an issue b/62262733 - * with reading incorrect data from EGLImage backed SkImage (likely a driver bug). + /* This intermediate surface is present to work around limitations that LayerDrawable expects + * to render into a GPU backed canvas. Additionally, the offscreen buffer solution works around + * a scaling issue (b/62262733) that was encountered when sampling from an EGLImage into a + * software buffer. */ sk_sp tmpSurface = SkSurface::MakeRenderTarget(mRenderThread.getGrContext(), SkBudgeted::kYes, bitmap->info(), 0,