Fix for HardwareBufferRenderer pre-rotation
Updated transform matrix to match the implementation
within VulkanSurface.cpp
Updated getFrame logic to return the logical dimensions
of a HardwareBuffer target instead of the width/height
of a HardwareBuffer in case pre-rotation transforms
are applied
Fixes: 276362013
Test: Updated HardwareBufferRendererTests
Change-Id: I9877af52a81804facc8b89b65cce3433b96655dc
diff --git a/libs/hwui/renderthread/HardwareBufferRenderParams.h b/libs/hwui/renderthread/HardwareBufferRenderParams.h
index 91fe3f6..8c942d0 100644
--- a/libs/hwui/renderthread/HardwareBufferRenderParams.h
+++ b/libs/hwui/renderthread/HardwareBufferRenderParams.h
@@ -36,9 +36,12 @@
class HardwareBufferRenderParams {
public:
HardwareBufferRenderParams() = default;
- HardwareBufferRenderParams(const SkMatrix& transform, const sk_sp<SkColorSpace>& colorSpace,
+ HardwareBufferRenderParams(int32_t logicalWidth, int32_t logicalHeight,
+ const SkMatrix& transform, const sk_sp<SkColorSpace>& colorSpace,
RenderCallback&& callback)
- : mTransform(transform)
+ : mLogicalWidth(logicalWidth)
+ , mLogicalHeight(logicalHeight)
+ , mTransform(transform)
, mColorSpace(colorSpace)
, mRenderCallback(std::move(callback)) {}
const SkMatrix& getTransform() const { return mTransform; }
@@ -50,7 +53,12 @@
}
}
+ int32_t getLogicalWidth() { return mLogicalWidth; }
+ int32_t getLogicalHeight() { return mLogicalHeight; }
+
private:
+ int32_t mLogicalWidth;
+ int32_t mLogicalHeight;
SkMatrix mTransform = SkMatrix::I();
sk_sp<SkColorSpace> mColorSpace = SkColorSpace::MakeSRGB();
RenderCallback mRenderCallback = nullptr;