summaryrefslogtreecommitdiffstats
path: root/gfx/layers/CanvasDrawEventRecorder.h
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/layers/CanvasDrawEventRecorder.h')
-rw-r--r--gfx/layers/CanvasDrawEventRecorder.h24
1 files changed, 21 insertions, 3 deletions
diff --git a/gfx/layers/CanvasDrawEventRecorder.h b/gfx/layers/CanvasDrawEventRecorder.h
index a4b1261cfb..c9eacf27ac 100644
--- a/gfx/layers/CanvasDrawEventRecorder.h
+++ b/gfx/layers/CanvasDrawEventRecorder.h
@@ -21,6 +21,10 @@ namespace mozilla {
using EventType = gfx::RecordedEvent::EventType;
+namespace dom {
+class ThreadSafeWorkerRef;
+}
+
namespace layers {
typedef mozilla::ipc::SharedMemoryBasic::Handle Handle;
@@ -31,7 +35,8 @@ class CanvasDrawEventRecorder final : public gfx::DrawEventRecorderPrivate,
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(CanvasDrawEventRecorder, final)
- CanvasDrawEventRecorder();
+ explicit CanvasDrawEventRecorder(dom::ThreadSafeWorkerRef* aWorkerRef);
+ ~CanvasDrawEventRecorder() override;
enum class State : uint32_t {
Processing,
@@ -68,6 +73,7 @@ class CanvasDrawEventRecorder final : public gfx::DrawEventRecorderPrivate,
virtual ~Helpers() = default;
virtual bool InitTranslator(TextureType aTextureType,
+ TextureType aWebglTextureType,
gfx::BackendType aBackendType,
Handle&& aReadHandle,
nsTArray<Handle>&& aBufferHandles,
@@ -89,8 +95,8 @@ class CanvasDrawEventRecorder final : public gfx::DrawEventRecorderPrivate,
virtual bool RestartReader() = 0;
};
- bool Init(TextureType aTextureType, gfx::BackendType aBackendType,
- UniquePtr<Helpers> aHelpers);
+ bool Init(TextureType aTextureType, TextureType aWebglTextureType,
+ gfx::BackendType aBackendType, UniquePtr<Helpers> aHelpers);
/**
* Record an event for processing by the CanvasParent's CanvasTranslator.
@@ -98,6 +104,10 @@ class CanvasDrawEventRecorder final : public gfx::DrawEventRecorderPrivate,
*/
void RecordEvent(const gfx::RecordedEvent& aEvent) final;
+ void DetachResources() final;
+
+ void AddPendingDeletion(std::function<void()>&& aPendingDeletion) override;
+
void StoreSourceSurfaceRecording(gfx::SourceSurface* aSurface,
const char* aReason) final;
@@ -134,6 +144,11 @@ class CanvasDrawEventRecorder final : public gfx::DrawEventRecorderPrivate,
void CheckAndSignalReader();
+ void QueueProcessPendingDeletions(
+ RefPtr<CanvasDrawEventRecorder>&& aRecorder);
+ void QueueProcessPendingDeletionsLocked(
+ RefPtr<CanvasDrawEventRecorder>&& aRecorder);
+
size_t mDefaultBufferSize;
size_t mMaxDefaultBuffers;
uint32_t mMaxSpinCount;
@@ -173,6 +188,9 @@ class CanvasDrawEventRecorder final : public gfx::DrawEventRecorderPrivate,
UniquePtr<CrossProcessSemaphore> mWriterSemaphore;
UniquePtr<CrossProcessSemaphore> mReaderSemaphore;
+
+ RefPtr<dom::ThreadSafeWorkerRef> mWorkerRef;
+ bool mIsOnWorker = false;
};
} // namespace layers