Merge "Revert "CTS of CtsMediaTestCases#android.media.cts.DecodeAccuracyTest may fail when video is cropped."" am: fbc849e9d8 am: 423a67e7aa

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1959133

Change-Id: I424622d3590d3d48bad323ea19c7806a945e44f5
This commit is contained in:
Treehugger Robot
2022-01-27 08:58:27 +00:00
committed by Automerger Merge Worker

View File

@@ -32,8 +32,6 @@
using namespace android::uirenderer::renderthread; using namespace android::uirenderer::renderthread;
static constexpr bool sEnableExtraCropInset = true;
namespace android { namespace android {
namespace uirenderer { namespace uirenderer {
@@ -66,20 +64,6 @@ CopyResult Readback::copySurfaceInto(ANativeWindow* window, const Rect& inSrcRec
ALOGW("Surface doesn't have any previously queued frames, nothing to readback from"); ALOGW("Surface doesn't have any previously queued frames, nothing to readback from");
return CopyResult::SourceEmpty; return CopyResult::SourceEmpty;
} }
if (sEnableExtraCropInset &&
(cropRect.right - cropRect.left != bitmap->width() ||
cropRect.bottom - cropRect.top != bitmap->height())) {
/*
* When we need use filtering, we should also make border shrink here like gui.
* But we could not check format for YUV or RGB here... Just use 1 pix.
*/
cropRect.left += 0.5f;
cropRect.top += 0.5f;
cropRect.right -= 0.5f;
cropRect.bottom -= 0.5f;
}
UniqueAHardwareBuffer sourceBuffer{rawSourceBuffer}; UniqueAHardwareBuffer sourceBuffer{rawSourceBuffer};
AHardwareBuffer_Desc description; AHardwareBuffer_Desc description;
AHardwareBuffer_describe(sourceBuffer.get(), &description); AHardwareBuffer_describe(sourceBuffer.get(), &description);