Loading libs/hwui/DisplayList.h +11 −0 Original line number Diff line number Diff line Loading @@ -133,6 +133,12 @@ public: } } void onRemovedFromTree() { if (mImpl) { mImpl->onRemovedFromTree(); } } [[nodiscard]] bool hasText() const { return mImpl && mImpl->hasText(); } Loading Loading @@ -172,6 +178,7 @@ private: return false; } void syncContents(const WebViewSyncData& data) { } void onRemovedFromTree() { } void applyColorTransform(ColorTransform transform) { } }; Loading Loading @@ -298,6 +305,10 @@ public: apply([&](auto& it) { it.syncContents(data); }); } void onRemovedFromTree() { apply([&](auto& it) { it.onRemovedFromTree(); }); } [[nodiscard]] bool hasText() const { return apply([](const auto& it) -> auto { return it.hasText(); }); } Loading libs/hwui/RenderNode.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ #include "DamageAccumulator.h" #include "Debug.h" #include "Properties.h" #include "TreeInfo.h" #include "VectorDrawable.h" #include "private/hwui/WebViewFunctor.h" Loading Loading @@ -473,6 +474,9 @@ void RenderNode::decParentRefCount(TreeObserver& observer, TreeInfo* info) { } void RenderNode::onRemovedFromTree(TreeInfo* info) { if (Properties::enableWebViewOverlays && mDisplayList) { mDisplayList.onRemovedFromTree(); } destroyHardwareResources(info); } Loading libs/hwui/WebViewFunctorManager.cpp +13 −2 Original line number Diff line number Diff line Loading @@ -108,6 +108,13 @@ void WebViewFunctor::sync(const WebViewSyncData& syncData) const { mCallbacks.onSync(mFunctor, mData, syncData); } void WebViewFunctor::onRemovedFromTree() { ATRACE_NAME("WebViewFunctor::onRemovedFromTree"); if (mSurfaceControl) { removeOverlays(); } } void WebViewFunctor::drawGl(const DrawGlInfo& drawInfo) { ATRACE_NAME("WebViewFunctor::drawGl"); if (!mHasContext) { Loading Loading @@ -185,6 +192,7 @@ void WebViewFunctor::removeOverlays() { ScopedCurrentFunctor currentFunctor(this); mCallbacks.removeOverlays(mFunctor, mData, currentFunctor.mergeTransaction); if (mSurfaceControl) { reparentSurfaceControl(nullptr); auto funcs = renderthread::RenderThread::getInstance().getASurfaceControlFunctions(); funcs.releaseFunc(mSurfaceControl); mSurfaceControl = nullptr; Loading Loading @@ -217,9 +225,12 @@ ASurfaceControl* WebViewFunctor::getSurfaceControl() { void WebViewFunctor::mergeTransaction(ASurfaceTransaction* transaction) { ATRACE_NAME("WebViewFunctor::mergeTransaction"); if (transaction == nullptr) return; bool done = false; renderthread::CanvasContext* activeContext = renderthread::CanvasContext::getActiveContext(); LOG_ALWAYS_FATAL_IF(activeContext == nullptr, "Null active canvas context!"); bool done = activeContext->mergeTransaction(transaction, mSurfaceControl); // activeContext might be null when called from mCallbacks.removeOverlays() if (activeContext != nullptr) { done = activeContext->mergeTransaction(transaction, mSurfaceControl); } if (!done) { auto funcs = renderthread::RenderThread::getInstance().getASurfaceControlFunctions(); funcs.transactionApplyFunc(transaction); Loading libs/hwui/WebViewFunctorManager.h +3 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,8 @@ public: void removeOverlays() { mReference.removeOverlays(); } void onRemovedFromTree() { mReference.onRemovedFromTree(); } private: friend class WebViewFunctor; Loading @@ -74,6 +76,7 @@ public: void postDrawVk(); void destroyContext(); void removeOverlays(); void onRemovedFromTree(); ASurfaceControl* getSurfaceControl(); void mergeTransaction(ASurfaceTransaction* transaction); Loading libs/hwui/canvas/CanvasOpBuffer.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,10 @@ void CanvasOpBuffer::syncContents(const WebViewSyncData& data) { LOG_ALWAYS_FATAL("TODO"); } void CanvasOpBuffer::onRemovedFromTree() { LOG_ALWAYS_FATAL("TODO"); } void CanvasOpBuffer::applyColorTransform(ColorTransform transform) { LOG_ALWAYS_FATAL("TODO"); } Loading Loading
libs/hwui/DisplayList.h +11 −0 Original line number Diff line number Diff line Loading @@ -133,6 +133,12 @@ public: } } void onRemovedFromTree() { if (mImpl) { mImpl->onRemovedFromTree(); } } [[nodiscard]] bool hasText() const { return mImpl && mImpl->hasText(); } Loading Loading @@ -172,6 +178,7 @@ private: return false; } void syncContents(const WebViewSyncData& data) { } void onRemovedFromTree() { } void applyColorTransform(ColorTransform transform) { } }; Loading Loading @@ -298,6 +305,10 @@ public: apply([&](auto& it) { it.syncContents(data); }); } void onRemovedFromTree() { apply([&](auto& it) { it.onRemovedFromTree(); }); } [[nodiscard]] bool hasText() const { return apply([](const auto& it) -> auto { return it.hasText(); }); } Loading
libs/hwui/RenderNode.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ #include "DamageAccumulator.h" #include "Debug.h" #include "Properties.h" #include "TreeInfo.h" #include "VectorDrawable.h" #include "private/hwui/WebViewFunctor.h" Loading Loading @@ -473,6 +474,9 @@ void RenderNode::decParentRefCount(TreeObserver& observer, TreeInfo* info) { } void RenderNode::onRemovedFromTree(TreeInfo* info) { if (Properties::enableWebViewOverlays && mDisplayList) { mDisplayList.onRemovedFromTree(); } destroyHardwareResources(info); } Loading
libs/hwui/WebViewFunctorManager.cpp +13 −2 Original line number Diff line number Diff line Loading @@ -108,6 +108,13 @@ void WebViewFunctor::sync(const WebViewSyncData& syncData) const { mCallbacks.onSync(mFunctor, mData, syncData); } void WebViewFunctor::onRemovedFromTree() { ATRACE_NAME("WebViewFunctor::onRemovedFromTree"); if (mSurfaceControl) { removeOverlays(); } } void WebViewFunctor::drawGl(const DrawGlInfo& drawInfo) { ATRACE_NAME("WebViewFunctor::drawGl"); if (!mHasContext) { Loading Loading @@ -185,6 +192,7 @@ void WebViewFunctor::removeOverlays() { ScopedCurrentFunctor currentFunctor(this); mCallbacks.removeOverlays(mFunctor, mData, currentFunctor.mergeTransaction); if (mSurfaceControl) { reparentSurfaceControl(nullptr); auto funcs = renderthread::RenderThread::getInstance().getASurfaceControlFunctions(); funcs.releaseFunc(mSurfaceControl); mSurfaceControl = nullptr; Loading Loading @@ -217,9 +225,12 @@ ASurfaceControl* WebViewFunctor::getSurfaceControl() { void WebViewFunctor::mergeTransaction(ASurfaceTransaction* transaction) { ATRACE_NAME("WebViewFunctor::mergeTransaction"); if (transaction == nullptr) return; bool done = false; renderthread::CanvasContext* activeContext = renderthread::CanvasContext::getActiveContext(); LOG_ALWAYS_FATAL_IF(activeContext == nullptr, "Null active canvas context!"); bool done = activeContext->mergeTransaction(transaction, mSurfaceControl); // activeContext might be null when called from mCallbacks.removeOverlays() if (activeContext != nullptr) { done = activeContext->mergeTransaction(transaction, mSurfaceControl); } if (!done) { auto funcs = renderthread::RenderThread::getInstance().getASurfaceControlFunctions(); funcs.transactionApplyFunc(transaction); Loading
libs/hwui/WebViewFunctorManager.h +3 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,8 @@ public: void removeOverlays() { mReference.removeOverlays(); } void onRemovedFromTree() { mReference.onRemovedFromTree(); } private: friend class WebViewFunctor; Loading @@ -74,6 +76,7 @@ public: void postDrawVk(); void destroyContext(); void removeOverlays(); void onRemovedFromTree(); ASurfaceControl* getSurfaceControl(); void mergeTransaction(ASurfaceTransaction* transaction); Loading
libs/hwui/canvas/CanvasOpBuffer.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,10 @@ void CanvasOpBuffer::syncContents(const WebViewSyncData& data) { LOG_ALWAYS_FATAL("TODO"); } void CanvasOpBuffer::onRemovedFromTree() { LOG_ALWAYS_FATAL("TODO"); } void CanvasOpBuffer::applyColorTransform(ColorTransform transform) { LOG_ALWAYS_FATAL("TODO"); } Loading