Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/skia/android/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ add_library(
"${PROJECT_SOURCE_DIR}/../cpp/api/third_party/base64.cpp"
"${PROJECT_SOURCE_DIR}/../cpp/api/third_party/SkottieUtils.cpp"

"${PROJECT_SOURCE_DIR}/../cpp/api/JsiSkDispatcher.cpp"
${BACKEND_SOURCES}
)

Expand Down
9 changes: 0 additions & 9 deletions packages/skia/cpp/api/JsiSkDispatcher.cpp

This file was deleted.

149 changes: 0 additions & 149 deletions packages/skia/cpp/api/JsiSkDispatcher.h

This file was deleted.

21 changes: 0 additions & 21 deletions packages/skia/cpp/api/JsiSkImage.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include <string>
#include <utility>

#include "JsiSkDispatcher.h"
#include "JsiSkHostObjects.h"
#include "JsiSkImageInfo.h"
#include "JsiSkMatrix.h"
Expand Down Expand Up @@ -64,9 +63,6 @@ inline SkSamplingOptions SamplingOptionsFromValue(jsi::Runtime &runtime,
}

class JsiSkImage : public JsiSkWrappingSkPtrHostObject<SkImage> {
private:
std::shared_ptr<Dispatcher> _dispatcher;

public:
// TODO-API: Properties?
JSI_HOST_FUNCTION(width) { return static_cast<double>(getObject()->width()); }
Expand Down Expand Up @@ -287,23 +283,6 @@ class JsiSkImage : public JsiSkWrappingSkPtrHostObject<SkImage> {
const sk_sp<SkImage> image)
: JsiSkWrappingSkPtrHostObject<SkImage>(std::move(context),
std::move(image)) {
// Get the dispatcher for the current thread
_dispatcher = Dispatcher::getDispatcher();
// Process any pending operations
_dispatcher->processQueue();
}

protected:
void releaseResources() override {
// Queue deletion on the creation thread if needed
auto image = getObjectUnchecked();
if (image && _dispatcher) {
_dispatcher->run([image]() {
// Image will be deleted when this lambda is destroyed
});
}
// Clear the object
JsiSkWrappingSkPtrHostObject<SkImage>::releaseResources();
}

public:
Expand Down
21 changes: 0 additions & 21 deletions packages/skia/cpp/api/JsiSkPicture.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <memory>

#include "JsiSkData.h"
#include "JsiSkDispatcher.h"
#include "JsiSkHostObjects.h"
#include "JsiSkMatrix.h"
#include "JsiSkRect.h"
Expand All @@ -21,30 +20,10 @@ namespace RNSkia {
namespace jsi = facebook::jsi;

class JsiSkPicture : public JsiSkWrappingSkPtrHostObject<SkPicture> {
private:
std::shared_ptr<Dispatcher> _dispatcher;

public:
JsiSkPicture(std::shared_ptr<RNSkPlatformContext> context,
const sk_sp<SkPicture> picture)
: JsiSkWrappingSkPtrHostObject<SkPicture>(context, picture) {
// Get the dispatcher for the current thread
_dispatcher = Dispatcher::getDispatcher();
// Process any pending operations
_dispatcher->processQueue();
}

protected:
void releaseResources() override {
// Queue deletion on the creation thread if needed
auto picture = getObjectUnchecked();
if (picture && _dispatcher) {
_dispatcher->run([picture]() {
// Picture will be deleted when this lambda is destroyed
});
}
// Clear the object
JsiSkWrappingSkPtrHostObject<SkPicture>::releaseResources();
}

public:
Expand Down
21 changes: 0 additions & 21 deletions packages/skia/cpp/api/JsiSkSurface.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

#include <jsi/jsi.h>

#include "JsiSkDispatcher.h"
#include "JsiSkHostObjects.h"
#include "JsiTextureInfo.h"

Expand All @@ -31,31 +30,11 @@ namespace RNSkia {
namespace jsi = facebook::jsi;

class JsiSkSurface : public JsiSkWrappingSkPtrHostObject<SkSurface> {
private:
std::shared_ptr<Dispatcher> _dispatcher;

public:
JsiSkSurface(std::shared_ptr<RNSkPlatformContext> context,
sk_sp<SkSurface> surface)
: JsiSkWrappingSkPtrHostObject<SkSurface>(std::move(context),
std::move(surface)) {
// Get the dispatcher for the current thread
_dispatcher = Dispatcher::getDispatcher();
// Process any pending operations
_dispatcher->processQueue();
}

protected:
void releaseResources() override {
// Queue deletion on the creation thread if needed
auto surface = getObjectUnchecked();
if (surface && _dispatcher) {
_dispatcher->run([surface]() {
// Surface will be deleted when this lambda is destroyed
});
}
// Clear the object
JsiSkWrappingSkPtrHostObject<SkSurface>::releaseResources();
}

public:
Expand Down