Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5f1ac2b2 authored by Chris Blume's avatar Chris Blume
Browse files

Rename VkFunctorDrawable->VkInteropFunctorDrawable

The Vulkan functor is currently doing interop, calling into the real
OpenGL functor. We will be adding a real, non-interop Vulkan functor
soon. In order to enable that, this patch renames the existing
VkFunctorDrawable to VkInteropFunctorDrawable. That allows us to use the
name VkFunctorDrawable for the real functor.

Test: This is a simple rename. Existing unit tests should work.

BUG=115613038

Change-Id: I427ad4d17ee92c3832e7bace55450b41a036f557
parent 00b0f1d3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -176,7 +176,7 @@ cc_defaults {
        "pipeline/skia/SkiaRecordingCanvas.cpp",
        "pipeline/skia/SkiaVulkanPipeline.cpp",
        "pipeline/skia/VectorDrawableAtlas.cpp",
        "pipeline/skia/VkFunctorDrawable.cpp",
        "pipeline/skia/VkInteropFunctorDrawable.cpp",
        "renderstate/RenderState.cpp",
        "renderthread/CacheManager.cpp",
        "renderthread/CanvasContext.cpp",
+3 −3
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@
#include "RenderNode.h"
#include "pipeline/skia/AnimatedDrawables.h"
#include "pipeline/skia/GLFunctorDrawable.h"
#include "pipeline/skia/VkFunctorDrawable.h"
#include "pipeline/skia/VkInteropFunctorDrawable.h"

namespace android {
namespace uirenderer {
@@ -124,8 +124,8 @@ void SkiaRecordingCanvas::callDrawGLFunction(Functor* functor,
                                             uirenderer::GlFunctorLifecycleListener* listener) {
    FunctorDrawable* functorDrawable;
    if (Properties::getRenderPipelineType() == RenderPipelineType::SkiaVulkan) {
        functorDrawable = mDisplayList->allocateDrawable<VkFunctorDrawable>(functor, listener,
                asSkCanvas());
        functorDrawable = mDisplayList->allocateDrawable<VkInteropFunctorDrawable>(functor,
                listener, asSkCanvas());
    } else {
        functorDrawable = mDisplayList->allocateDrawable<GLFunctorDrawable>(functor, listener,
                asSkCanvas());
+2 −2
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@
#include "SkiaProfileRenderer.h"
#include "renderstate/RenderState.h"
#include "renderthread/Frame.h"
#include "VkFunctorDrawable.h"
#include "VkInteropFunctorDrawable.h"

#include <SkSurface.h>
#include <SkTypes.h>
@@ -144,7 +144,7 @@ bool SkiaVulkanPipeline::isContextReady() {
}

void SkiaVulkanPipeline::invokeFunctor(const RenderThread& thread, Functor* functor) {
    VkFunctorDrawable::vkInvokeFunctor(functor);
    VkInteropFunctorDrawable::vkInvokeFunctor(functor);
}

sk_sp<Bitmap> SkiaVulkanPipeline::allocateHardwareBitmap(renderthread::RenderThread& renderThread,
+5 −5
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
 * limitations under the License.
 */

#include "VkFunctorDrawable.h"
#include "VkInteropFunctorDrawable.h"
#include <private/hwui/DrawGlInfo.h>

#include "renderthread/EglManager.h"
@@ -64,7 +64,7 @@ private:
    }
};

void VkFunctorDrawable::vkInvokeFunctor(Functor* functor) {
void VkInteropFunctorDrawable::vkInvokeFunctor(Functor* functor) {
    ScopedDrawRequest _drawRequest{};
    sGLDrawThread->queue().runSync([&]() {
        EGLDisplay display = sEglManager.eglDisplay();
@@ -78,7 +78,7 @@ void VkFunctorDrawable::vkInvokeFunctor(Functor* functor) {

#define FENCE_TIMEOUT 2000000000

void VkFunctorDrawable::onDraw(SkCanvas* canvas) {
void VkInteropFunctorDrawable::onDraw(SkCanvas* canvas) {
    ATRACE_CALL();

    if (canvas->getGrContext() == nullptr) {
@@ -202,7 +202,7 @@ void VkFunctorDrawable::onDraw(SkCanvas* canvas) {
    canvas->restore();
}

VkFunctorDrawable::~VkFunctorDrawable() {
VkInteropFunctorDrawable::~VkInteropFunctorDrawable() {
    if (mListener.get() != nullptr) {
        ScopedDrawRequest _drawRequest{};
        sGLDrawThread->queue().runSync([&]() {
@@ -211,7 +211,7 @@ VkFunctorDrawable::~VkFunctorDrawable() {
    }
}

void VkFunctorDrawable::syncFunctor() const {
void VkInteropFunctorDrawable::syncFunctor() const {
    ScopedDrawRequest _drawRequest{};
    sGLDrawThread->queue().runSync([&]() {
         (*mFunctor)(DrawGlInfo::kModeSync, nullptr);
+4 −3
Original line number Diff line number Diff line
@@ -30,11 +30,12 @@ namespace skiapipeline {
 * This drawable wraps a Vulkan functor enabling it to be recorded into a list
 * of Skia drawing commands.
 */
class VkFunctorDrawable : public FunctorDrawable {
class VkInteropFunctorDrawable : public FunctorDrawable {
public:
    VkFunctorDrawable(Functor* functor, GlFunctorLifecycleListener* listener, SkCanvas* canvas)
    VkInteropFunctorDrawable(Functor* functor, GlFunctorLifecycleListener* listener,
            SkCanvas* canvas)
            : FunctorDrawable(functor, listener, canvas) {}
    virtual ~VkFunctorDrawable();
    virtual ~VkInteropFunctorDrawable();

    void syncFunctor() const override;