summaryrefslogtreecommitdiffstats
path: root/gfx/2d/DrawEventRecorder.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /gfx/2d/DrawEventRecorder.h
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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;
};