Loading libs/hwui/WebViewFunctorManager.cpp +24 −15 Original line number Diff line number Diff line Loading @@ -118,6 +118,24 @@ void WebViewFunctor::onRemovedFromTree() { } } bool WebViewFunctor::prepareRootSurfaceControl() { if (!Properties::enableWebViewOverlays) return false; renderthread::CanvasContext* activeContext = renderthread::CanvasContext::getActiveContext(); if (!activeContext) return false; ASurfaceControl* rootSurfaceControl = activeContext->getSurfaceControl(); if (!rootSurfaceControl) return false; int32_t rgid = activeContext->getSurfaceControlGenerationId(); if (mParentSurfaceControlGenerationId != rgid) { reparentSurfaceControl(rootSurfaceControl); mParentSurfaceControlGenerationId = rgid; } return true; } void WebViewFunctor::drawGl(const DrawGlInfo& drawInfo) { ATRACE_NAME("WebViewFunctor::drawGl"); if (!mHasContext) { Loading @@ -131,20 +149,8 @@ void WebViewFunctor::drawGl(const DrawGlInfo& drawInfo) { .mergeTransaction = currentFunctor.mergeTransaction, }; if (Properties::enableWebViewOverlays && !drawInfo.isLayer) { renderthread::CanvasContext* activeContext = renderthread::CanvasContext::getActiveContext(); if (activeContext != nullptr) { ASurfaceControl* rootSurfaceControl = activeContext->getSurfaceControl(); if (rootSurfaceControl) { if (!drawInfo.isLayer && prepareRootSurfaceControl()) { overlayParams.overlaysMode = OverlaysMode::Enabled; int32_t rgid = activeContext->getSurfaceControlGenerationId(); if (mParentSurfaceControlGenerationId != rgid) { reparentSurfaceControl(rootSurfaceControl); mParentSurfaceControlGenerationId = rgid; } } } } mCallbacks.gles.draw(mFunctor, mData, drawInfo, overlayParams); Loading @@ -170,7 +176,10 @@ void WebViewFunctor::drawVk(const VkFunctorDrawParams& params) { .mergeTransaction = currentFunctor.mergeTransaction, }; // TODO, enable surface control once offscreen mode figured out if (!params.is_layer && prepareRootSurfaceControl()) { overlayParams.overlaysMode = OverlaysMode::Enabled; } mCallbacks.vk.draw(mFunctor, mData, params, overlayParams); } Loading libs/hwui/WebViewFunctorManager.h +1 −0 Original line number Diff line number Diff line Loading @@ -88,6 +88,7 @@ public: } private: bool prepareRootSurfaceControl(); void reparentSurfaceControl(ASurfaceControl* parent); private: Loading libs/hwui/pipeline/skia/VkFunctorDrawable.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -72,6 +72,7 @@ void VkFunctorDrawHandler::draw(const GrBackendDrawableInfo& info) { .clip_top = mClip.fTop, .clip_right = mClip.fRight, .clip_bottom = mClip.fBottom, .is_layer = !vulkan_info.fFromSwapchainOrAndroidWindow, }; mat4.getColMajor(¶ms.transform[0]); params.secondary_command_buffer = vulkan_info.fSecondaryCommandBuffer; Loading libs/hwui/private/hwui/DrawVkInfo.h +3 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,9 @@ struct VkFunctorDrawParams { int clip_top; int clip_right; int clip_bottom; // Input: Whether destination surface is offscreen surface. bool is_layer; }; } // namespace uirenderer Loading libs/hwui/renderthread/VulkanSurface.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -426,7 +426,7 @@ VulkanSurface::NativeBufferInfo* VulkanSurface::dequeueNativeBuffer() { if (bufferInfo->skSurface.get() == nullptr) { bufferInfo->skSurface = SkSurface::MakeFromAHardwareBuffer( mGrContext, ANativeWindowBuffer_getHardwareBuffer(bufferInfo->buffer.get()), kTopLeft_GrSurfaceOrigin, mWindowInfo.colorspace, nullptr); kTopLeft_GrSurfaceOrigin, mWindowInfo.colorspace, nullptr, /*from_window=*/true); if (bufferInfo->skSurface.get() == nullptr) { ALOGE("SkSurface::MakeFromAHardwareBuffer failed"); mNativeWindow->cancelBuffer(mNativeWindow.get(), buffer, Loading Loading
libs/hwui/WebViewFunctorManager.cpp +24 −15 Original line number Diff line number Diff line Loading @@ -118,6 +118,24 @@ void WebViewFunctor::onRemovedFromTree() { } } bool WebViewFunctor::prepareRootSurfaceControl() { if (!Properties::enableWebViewOverlays) return false; renderthread::CanvasContext* activeContext = renderthread::CanvasContext::getActiveContext(); if (!activeContext) return false; ASurfaceControl* rootSurfaceControl = activeContext->getSurfaceControl(); if (!rootSurfaceControl) return false; int32_t rgid = activeContext->getSurfaceControlGenerationId(); if (mParentSurfaceControlGenerationId != rgid) { reparentSurfaceControl(rootSurfaceControl); mParentSurfaceControlGenerationId = rgid; } return true; } void WebViewFunctor::drawGl(const DrawGlInfo& drawInfo) { ATRACE_NAME("WebViewFunctor::drawGl"); if (!mHasContext) { Loading @@ -131,20 +149,8 @@ void WebViewFunctor::drawGl(const DrawGlInfo& drawInfo) { .mergeTransaction = currentFunctor.mergeTransaction, }; if (Properties::enableWebViewOverlays && !drawInfo.isLayer) { renderthread::CanvasContext* activeContext = renderthread::CanvasContext::getActiveContext(); if (activeContext != nullptr) { ASurfaceControl* rootSurfaceControl = activeContext->getSurfaceControl(); if (rootSurfaceControl) { if (!drawInfo.isLayer && prepareRootSurfaceControl()) { overlayParams.overlaysMode = OverlaysMode::Enabled; int32_t rgid = activeContext->getSurfaceControlGenerationId(); if (mParentSurfaceControlGenerationId != rgid) { reparentSurfaceControl(rootSurfaceControl); mParentSurfaceControlGenerationId = rgid; } } } } mCallbacks.gles.draw(mFunctor, mData, drawInfo, overlayParams); Loading @@ -170,7 +176,10 @@ void WebViewFunctor::drawVk(const VkFunctorDrawParams& params) { .mergeTransaction = currentFunctor.mergeTransaction, }; // TODO, enable surface control once offscreen mode figured out if (!params.is_layer && prepareRootSurfaceControl()) { overlayParams.overlaysMode = OverlaysMode::Enabled; } mCallbacks.vk.draw(mFunctor, mData, params, overlayParams); } Loading
libs/hwui/WebViewFunctorManager.h +1 −0 Original line number Diff line number Diff line Loading @@ -88,6 +88,7 @@ public: } private: bool prepareRootSurfaceControl(); void reparentSurfaceControl(ASurfaceControl* parent); private: Loading
libs/hwui/pipeline/skia/VkFunctorDrawable.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -72,6 +72,7 @@ void VkFunctorDrawHandler::draw(const GrBackendDrawableInfo& info) { .clip_top = mClip.fTop, .clip_right = mClip.fRight, .clip_bottom = mClip.fBottom, .is_layer = !vulkan_info.fFromSwapchainOrAndroidWindow, }; mat4.getColMajor(¶ms.transform[0]); params.secondary_command_buffer = vulkan_info.fSecondaryCommandBuffer; Loading
libs/hwui/private/hwui/DrawVkInfo.h +3 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,9 @@ struct VkFunctorDrawParams { int clip_top; int clip_right; int clip_bottom; // Input: Whether destination surface is offscreen surface. bool is_layer; }; } // namespace uirenderer Loading
libs/hwui/renderthread/VulkanSurface.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -426,7 +426,7 @@ VulkanSurface::NativeBufferInfo* VulkanSurface::dequeueNativeBuffer() { if (bufferInfo->skSurface.get() == nullptr) { bufferInfo->skSurface = SkSurface::MakeFromAHardwareBuffer( mGrContext, ANativeWindowBuffer_getHardwareBuffer(bufferInfo->buffer.get()), kTopLeft_GrSurfaceOrigin, mWindowInfo.colorspace, nullptr); kTopLeft_GrSurfaceOrigin, mWindowInfo.colorspace, nullptr, /*from_window=*/true); if (bufferInfo->skSurface.get() == nullptr) { ALOGE("SkSurface::MakeFromAHardwareBuffer failed"); mNativeWindow->cancelBuffer(mNativeWindow.get(), buffer, Loading