/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
class CanvasDrawEventRecorder final : public gfx::DrawEventRecorderPrivate, public gfx::ContiguousBufferStream { public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(CanvasDrawEventRecorder, final)
/** * This is the important state to make sure the other side signals or starts * us as soon as data or space is available. We set AboutToWait first and * then re-check the condition. If we went straight to Waiting or Stopped * then in between the last check and setting the state, the other side * could have used all available data or space and never have signaled us * because it didn't know we were about to wait, causing a deadlock. * While we are in this state, the other side must wait until we resolve the * AboutToWait state to one of the other states and then signal or start us * if it needs to.
*/
AboutToWait,
Waiting,
Paused,
Stopped,
Failed,
};
/** * @returns true if the reader of the CanvasEventRingBuffer has permanently * stopped processing, otherwise returns false.
*/ virtualbool ReaderClosed() = 0;
/** * Causes the reader to resume processing when it is in a stopped state.
*/ virtualbool RestartReader() = 0;
};
/** * Record an event for processing by the CanvasParent's CanvasTranslator. * @param aEvent the event to record
*/ void RecordEvent(const gfx::RecordedEvent& aEvent) final;
void Flush() final { NS_ASSERT_OWNINGTHREAD(CanvasDrawEventRecorder); }
int64_t CreateCheckpoint();
/** * Waits until the given checkpoint has been read by the translator. * * @params aCheckpoint the checkpoint to wait for * @returns true if the checkpoint was reached, false if the reader is closed * or we timeout.
*/ bool WaitForCheckpoint(int64_t aCheckpoint);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.