summaryrefslogtreecommitdiffstats
path: root/gfx/2d/DrawEventRecorder.h
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/2d/DrawEventRecorder.h')
-rw-r--r--gfx/2d/DrawEventRecorder.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/gfx/2d/DrawEventRecorder.h b/gfx/2d/DrawEventRecorder.h
index d62f098784..c099973fbd 100644
--- a/gfx/2d/DrawEventRecorder.h
+++ b/gfx/2d/DrawEventRecorder.h
@@ -15,6 +15,7 @@
#include <functional>
#include <vector>
+#include "ImageContainer.h"
#include "mozilla/DataMutex.h"
#include "mozilla/ThreadSafeWeakPtr.h"
#include "nsTHashMap.h"
@@ -83,7 +84,8 @@ class DrawEventRecorderPrivate : public DrawEventRecorder {
virtual void RecordEvent(const RecordedEvent& aEvent) = 0;
- void RecordEvent(DrawTargetRecording* aDT, const RecordedEvent& aEvent) {
+ void RecordEvent(const DrawTargetRecording* aDT,
+ const RecordedEvent& aEvent) {
ReferencePtr dt = aDT;
if (mCurrentDT != dt) {
SetDrawTarget(dt);
@@ -93,7 +95,7 @@ class DrawEventRecorderPrivate : public DrawEventRecorder {
void SetDrawTarget(ReferencePtr aDT);
- void ClearDrawTarget(DrawTargetRecording* aDT) {
+ void ClearDrawTarget(const DrawTargetRecording* aDT) {
ReferencePtr dt = aDT;
if (mCurrentDT == dt) {
mCurrentDT = nullptr;
@@ -185,6 +187,12 @@ class DrawEventRecorderPrivate : public DrawEventRecorder {
virtual void StoreSourceSurfaceRecording(SourceSurface* aSurface,
const char* aReason);
+ virtual void StoreImageRecording(
+ const RefPtr<layers::Image>& aImageOfSurfaceDescriptor,
+ const char* aReasony) {
+ MOZ_ASSERT_UNREACHABLE("unexpected to be called");
+ }
+
/**
* Used when a source surface is destroyed, aSurface is a void* instead of a
* SourceSurface* because this is called during the SourceSurface destructor,
@@ -209,11 +217,21 @@ class DrawEventRecorderPrivate : public DrawEventRecorder {
aSurfaces = std::move(mExternalSurfaces);
}
+ struct ExternalImageEntry {
+ RefPtr<layers::Image> mImage;
+ int64_t mEventCount = -1;
+ };
+
+ using ExternalImagesHolder = std::deque<ExternalImageEntry>;
+
protected:
NS_DECL_OWNINGTHREAD
void StoreExternalSurfaceRecording(SourceSurface* aSurface, uint64_t aKey);
+ void StoreExternalImageRecording(
+ const RefPtr<layers::Image>& aImageOfSurfaceDescriptor);
+
void ProcessPendingDeletions() {
NS_ASSERT_OWNINGTHREAD(DrawEventRecorderPrivate);
@@ -253,6 +271,7 @@ class DrawEventRecorderPrivate : public DrawEventRecorder {
ReferencePtr mCurrentDT;
ExternalSurfacesHolder mExternalSurfaces;
+ ExternalImagesHolder mExternalImages;
bool mExternalFonts;
};