diff options
Diffstat (limited to 'gfx/layers/CanvasDrawEventRecorder.cpp')
-rw-r--r-- | gfx/layers/CanvasDrawEventRecorder.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gfx/layers/CanvasDrawEventRecorder.cpp b/gfx/layers/CanvasDrawEventRecorder.cpp index af143bf5cb..6140fc4ba7 100644 --- a/gfx/layers/CanvasDrawEventRecorder.cpp +++ b/gfx/layers/CanvasDrawEventRecorder.cpp @@ -127,6 +127,7 @@ int64_t CanvasDrawEventRecorder::CreateCheckpoint() { int64_t checkpoint = mHeader->eventCount; RecordEvent(RecordedCheckpoint()); ClearProcessedExternalSurfaces(); + ClearProcessedExternalImages(); return checkpoint; } @@ -276,6 +277,7 @@ void CanvasDrawEventRecorder::DropFreeBuffers() { } ClearProcessedExternalSurfaces(); + ClearProcessedExternalImages(); } void CanvasDrawEventRecorder::IncrementEventCount() { @@ -444,6 +446,16 @@ void CanvasDrawEventRecorder::StoreSourceSurfaceRecording( DrawEventRecorderPrivate::StoreSourceSurfaceRecording(aSurface, aReason); } +void CanvasDrawEventRecorder::StoreImageRecording( + const RefPtr<Image>& aImageOfSurfaceDescriptor, const char* aReasony) { + NS_ASSERT_OWNINGTHREAD(CanvasDrawEventRecorder); + + StoreExternalImageRecording(aImageOfSurfaceDescriptor); + mExternalImages.back().mEventCount = mHeader->eventCount; + + ClearProcessedExternalImages(); +} + void CanvasDrawEventRecorder::ClearProcessedExternalSurfaces() { while (!mExternalSurfaces.empty()) { if (mExternalSurfaces.front().mEventCount > mHeader->processedCount) { @@ -453,5 +465,14 @@ void CanvasDrawEventRecorder::ClearProcessedExternalSurfaces() { } } +void CanvasDrawEventRecorder::ClearProcessedExternalImages() { + while (!mExternalImages.empty()) { + if (mExternalImages.front().mEventCount > mHeader->processedCount) { + break; + } + mExternalImages.pop_front(); + } +} + } // namespace layers } // namespace mozilla |