diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp
index ee1c2ec..c0f3086 100644
--- a/libs/hwui/renderthread/CanvasContext.cpp
+++ b/libs/hwui/renderthread/CanvasContext.cpp
@@ -153,7 +153,6 @@
 
 void CanvasContext::destroy() {
     stopDrawing();
-    setHardwareBuffer(nullptr);
     setSurface(nullptr);
     setSurfaceControl(nullptr);
     freePrefetchedLayers();
@@ -177,19 +176,6 @@
     native_window_set_buffer_count(window, bufferCount);
 }
 
-void CanvasContext::setHardwareBuffer(AHardwareBuffer* buffer) {
-    if (mHardwareBuffer) {
-        AHardwareBuffer_release(mHardwareBuffer);
-        mHardwareBuffer = nullptr;
-    }
-
-    if (buffer) {
-        AHardwareBuffer_acquire(buffer);
-        mHardwareBuffer = buffer;
-    }
-    mRenderPipeline->setHardwareBuffer(mHardwareBuffer);
-}
-
 void CanvasContext::setSurface(ANativeWindow* window, bool enableTimeout) {
     ATRACE_CALL();
 
@@ -275,7 +261,7 @@
             mRenderThread.removeFrameCallback(this);
             mRenderPipeline->onStop();
             mRenderThread.cacheManager().onContextStopped(this);
-        } else if (mIsDirty && hasOutputTarget()) {
+        } else if (mIsDirty && hasSurface()) {
             mRenderThread.postFrameCallback(this);
         }
     }
@@ -439,7 +425,7 @@
 
     mIsDirty = true;
 
-    if (CC_UNLIKELY(!hasOutputTarget())) {
+    if (CC_UNLIKELY(!hasSurface())) {
         mCurrentFrameInfo->addFlag(FrameInfoFlags::SkippedFrame);
         info.out.canDrawThisFrame = false;
         return;
@@ -584,7 +570,7 @@
         std::scoped_lock lock(mFrameMetricsReporterMutex);
         drawResult = mRenderPipeline->draw(frame, windowDirty, dirty, mLightGeometry,
                                            &mLayerUpdateQueue, mContentDrawBounds, mOpaque,
-                                           mLightInfo, mRenderNodes, &(profiler()), mBufferParams);
+                                           mLightInfo, mRenderNodes, &(profiler()));
     }
 
     uint64_t frameCompleteNr = getFrameNumber();
diff --git a/libs/hwui/renderthread/CanvasContext.h b/libs/hwui/renderthread/CanvasContext.h
index a811670..0f6b736 100644
--- a/libs/hwui/renderthread/CanvasContext.h
+++ b/libs/hwui/renderthread/CanvasContext.h
@@ -125,13 +125,12 @@
     // Won't take effect until next EGLSurface creation
     void setSwapBehavior(SwapBehavior swapBehavior);
 
-    void setHardwareBuffer(AHardwareBuffer* buffer);
     void setSurface(ANativeWindow* window, bool enableTimeout = true);
     void setSurfaceControl(ASurfaceControl* surfaceControl);
     bool pauseSurface();
     void setStopped(bool stopped);
-    bool isStopped() { return mStopped || !hasOutputTarget(); }
-    bool hasOutputTarget() const { return mNativeSurface.get() || mHardwareBuffer; }
+    bool isStopped() { return mStopped || !hasSurface(); }
+    bool hasSurface() const { return mNativeSurface.get(); }
     void allocateBuffers();
 
     void setLightAlpha(uint8_t ambientShadowAlpha, uint8_t spotShadowAlpha);
@@ -209,10 +208,6 @@
         mASurfaceTransactionCallback = callback;
     }
 
-    void setHardwareBufferRenderParams(const HardwareBufferRenderParams& params) {
-        mBufferParams = params;
-    }
-
     bool mergeTransaction(ASurfaceTransaction* transaction, ASurfaceControl* control);
 
     void setPrepareSurfaceControlForWebviewCallback(const std::function<void()>& callback) {
@@ -267,9 +262,6 @@
     int32_t mLastFrameHeight = 0;
 
     RenderThread& mRenderThread;
-
-    AHardwareBuffer* mHardwareBuffer = nullptr;
-    HardwareBufferRenderParams mBufferParams;
     std::unique_ptr<ReliableSurface> mNativeSurface;
     // The SurfaceControl reference is passed from ViewRootImpl, can be set to
     // NULL to remove the reference
diff --git a/libs/hwui/renderthread/DrawFrameTask.cpp b/libs/hwui/renderthread/DrawFrameTask.cpp
index fab2f46..ccdf715 100644
--- a/libs/hwui/renderthread/DrawFrameTask.cpp
+++ b/libs/hwui/renderthread/DrawFrameTask.cpp
@@ -26,7 +26,6 @@
 #include "../Properties.h"
 #include "../RenderNode.h"
 #include "CanvasContext.h"
-#include "HardwareBufferRenderParams.h"
 #include "RenderThread.h"
 
 namespace android {
@@ -93,9 +92,6 @@
     mContext->setSyncDelayDuration(systemTime(SYSTEM_TIME_MONOTONIC) - mSyncQueued);
     mContext->setTargetSdrHdrRatio(mRenderSdrHdrRatio);
 
-    auto hardwareBufferParams = mHardwareBufferParams;
-    mContext->setHardwareBufferRenderParams(hardwareBufferParams);
-    IRenderPipeline* pipeline = mContext->getRenderPipeline();
     bool canUnblockUiThread;
     bool canDrawThisFrame;
     {
@@ -155,11 +151,6 @@
     if (!canUnblockUiThread) {
         unblockUiThread();
     }
-
-    if (pipeline->hasHardwareBuffer()) {
-        auto fence = pipeline->flush();
-        hardwareBufferParams.invokeRenderCallback(std::move(fence), 0);
-    }
 }
 
 bool DrawFrameTask::syncFrameState(TreeInfo& info) {
@@ -185,9 +176,8 @@
 
     // This is after the prepareTree so that any pending operations
     // (RenderNode tree state, prefetched layers, etc...) will be flushed.
-    bool hasTarget = mContext->hasOutputTarget();
-    if (CC_UNLIKELY(!hasTarget || !canDraw)) {
-        if (!hasTarget) {
+    if (CC_UNLIKELY(!mContext->hasSurface() || !canDraw)) {
+        if (!mContext->hasSurface()) {
             mSyncResult |= SyncResult::LostSurfaceRewardIfFound;
         } else {
             // If we have a surface but can't draw we must be stopped
diff --git a/libs/hwui/renderthread/DrawFrameTask.h b/libs/hwui/renderthread/DrawFrameTask.h
index 4130d4a..4be8f6b 100644
--- a/libs/hwui/renderthread/DrawFrameTask.h
+++ b/libs/hwui/renderthread/DrawFrameTask.h
@@ -27,16 +27,8 @@
 #include "../Rect.h"
 #include "../TreeInfo.h"
 #include "RenderTask.h"
-#include "SkColorSpace.h"
-#include "SwapBehavior.h"
-#include "utils/TimeUtils.h"
-#ifdef __ANDROID__  // Layoutlib does not support hardware acceleration
-#include <android/hardware_buffer.h>
-#endif
-#include "HardwareBufferRenderParams.h"
 
 namespace android {
-
 namespace uirenderer {
 
 class DeferredLayerUpdater;
@@ -96,10 +88,6 @@
 
     void forceDrawNextFrame() { mForceDrawFrame = true; }
 
-    void setHardwareBufferRenderParams(const HardwareBufferRenderParams& params) {
-        mHardwareBufferParams = params;
-    }
-
     void setRenderSdrHdrRatio(float ratio) { mRenderSdrHdrRatio = ratio; }
 
 private:
@@ -126,7 +114,6 @@
 
     int64_t mFrameInfo[UI_THREAD_FRAME_INFO_SIZE];
 
-    HardwareBufferRenderParams mHardwareBufferParams;
     std::function<std::function<void(bool)>(int32_t, int64_t)> mFrameCallback;
     std::function<void(bool)> mFrameCommitCallback;
     std::function<void()> mFrameCompleteCallback;
diff --git a/libs/hwui/renderthread/HardwareBufferRenderParams.h b/libs/hwui/renderthread/HardwareBufferRenderParams.h
deleted file mode 100644
index 91fe3f6..0000000
--- a/libs/hwui/renderthread/HardwareBufferRenderParams.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#ifndef HARDWAREBUFFERRENDERER_H_
-#define HARDWAREBUFFERRENDERER_H_
-
-#include <android-base/unique_fd.h>
-#include <android/hardware_buffer.h>
-
-#include "SkColorSpace.h"
-#include "SkMatrix.h"
-#include "SkSurface.h"
-
-namespace android {
-namespace uirenderer {
-namespace renderthread {
-
-using namespace android::uirenderer::renderthread;
-
-using RenderCallback = std::function<void(android::base::unique_fd&&, int)>;
-
-class RenderProxy;
-
-class HardwareBufferRenderParams {
-public:
-    HardwareBufferRenderParams() = default;
-    HardwareBufferRenderParams(const SkMatrix& transform, const sk_sp<SkColorSpace>& colorSpace,
-                               RenderCallback&& callback)
-            : mTransform(transform)
-            , mColorSpace(colorSpace)
-            , mRenderCallback(std::move(callback)) {}
-    const SkMatrix& getTransform() const { return mTransform; }
-    sk_sp<SkColorSpace> getColorSpace() const { return mColorSpace; }
-
-    void invokeRenderCallback(android::base::unique_fd&& fenceFd, int status) {
-        if (mRenderCallback) {
-            std::invoke(mRenderCallback, std::move(fenceFd), status);
-        }
-    }
-
-private:
-    SkMatrix mTransform = SkMatrix::I();
-    sk_sp<SkColorSpace> mColorSpace = SkColorSpace::MakeSRGB();
-    RenderCallback mRenderCallback = nullptr;
-};
-
-}  // namespace renderthread
-}  // namespace uirenderer
-}  // namespace android
-#endif  // HARDWAREBUFFERRENDERER_H_
diff --git a/libs/hwui/renderthread/IRenderPipeline.h b/libs/hwui/renderthread/IRenderPipeline.h
index c68fcdf..18cad31 100644
--- a/libs/hwui/renderthread/IRenderPipeline.h
+++ b/libs/hwui/renderthread/IRenderPipeline.h
@@ -16,19 +16,17 @@
 
 #pragma once
 
-#include <SkColorSpace.h>
-#include <SkRect.h>
-#include <android-base/unique_fd.h>
-#include <utils/RefBase.h>
-
-#include "ColorMode.h"
 #include "DamageAccumulator.h"
 #include "FrameInfoVisualizer.h"
-#include "HardwareBufferRenderParams.h"
 #include "LayerUpdateQueue.h"
 #include "Lighting.h"
 #include "SwapBehavior.h"
 #include "hwui/Bitmap.h"
+#include "ColorMode.h"
+
+#include <SkColorSpace.h>
+#include <SkRect.h>
+#include <utils/RefBase.h>
 
 class GrDirectContext;
 
@@ -66,14 +64,10 @@
                             const LightGeometry& lightGeometry, LayerUpdateQueue* layerUpdateQueue,
                             const Rect& contentDrawBounds, bool opaque, const LightInfo& lightInfo,
                             const std::vector<sp<RenderNode>>& renderNodes,
-                            FrameInfoVisualizer* profiler,
-                            const HardwareBufferRenderParams& bufferParams) = 0;
+                            FrameInfoVisualizer* profiler) = 0;
     virtual bool swapBuffers(const Frame& frame, bool drew, const SkRect& screenDirty,
                              FrameInfo* currentFrameInfo, bool* requireSwap) = 0;
     virtual DeferredLayerUpdater* createTextureLayer() = 0;
-    [[nodiscard]] virtual android::base::unique_fd flush() = 0;
-    virtual void setHardwareBuffer(AHardwareBuffer* hardwareBuffer) = 0;
-    virtual bool hasHardwareBuffer() = 0;
     virtual bool setSurface(ANativeWindow* window, SwapBehavior swapBehavior) = 0;
     virtual void onStop() = 0;
     virtual bool isSurfaceReady() = 0;
diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp
index 1e011c2..f8e2dee 100644
--- a/libs/hwui/renderthread/RenderProxy.cpp
+++ b/libs/hwui/renderthread/RenderProxy.cpp
@@ -85,18 +85,6 @@
     mRenderThread.queue().runSync([this, name]() { mContext->setName(std::string(name)); });
 }
 
-void RenderProxy::setHardwareBuffer(AHardwareBuffer* buffer) {
-    if (buffer) {
-        AHardwareBuffer_acquire(buffer);
-    }
-    mRenderThread.queue().post([this, hardwareBuffer = buffer]() mutable {
-        mContext->setHardwareBuffer(hardwareBuffer);
-        if (hardwareBuffer) {
-            AHardwareBuffer_release(hardwareBuffer);
-        }
-    });
-}
-
 void RenderProxy::setSurface(ANativeWindow* window, bool enableTimeout) {
     if (window) { ANativeWindow_acquire(window); }
     mRenderThread.queue().post([this, win = window, enableTimeout]() mutable {
@@ -352,10 +340,6 @@
     mDrawFrameTask.setContentDrawBounds(left, top, right, bottom);
 }
 
-void RenderProxy::setHardwareBufferRenderParams(const HardwareBufferRenderParams& params) {
-    mDrawFrameTask.setHardwareBufferRenderParams(params);
-}
-
 void RenderProxy::setPictureCapturedCallback(
         const std::function<void(sk_sp<SkPicture>&&)>& callback) {
     mRenderThread.queue().post(
diff --git a/libs/hwui/renderthread/RenderProxy.h b/libs/hwui/renderthread/RenderProxy.h
index 82072a6..5dd65a0 100644
--- a/libs/hwui/renderthread/RenderProxy.h
+++ b/libs/hwui/renderthread/RenderProxy.h
@@ -18,7 +18,6 @@
 #define RENDERPROXY_H_
 
 #include <SkRefCnt.h>
-#include <android/hardware_buffer.h>
 #include <android/native_window.h>
 #include <android/surface_control.h>
 #include <cutils/compiler.h>
@@ -77,7 +76,7 @@
     void setSwapBehavior(SwapBehavior swapBehavior);
     bool loadSystemProperties();
     void setName(const char* name);
-    void setHardwareBuffer(AHardwareBuffer* buffer);
+
     void setSurface(ANativeWindow* window, bool enableTimeout = true);
     void setSurfaceControl(ASurfaceControl* surfaceControl);
     void allocateBuffers();
@@ -85,7 +84,6 @@
     void setStopped(bool stopped);
     void setLightAlpha(uint8_t ambientShadowAlpha, uint8_t spotShadowAlpha);
     void setLightGeometry(const Vector3& lightCenter, float lightRadius);
-    void setHardwareBufferRenderParams(const HardwareBufferRenderParams& params);
     void setOpaque(bool opaque);
     float setColorMode(ColorMode mode);
     void setRenderSdrHdrRatio(float ratio);
