Add documentation for the new rotated buffer subclasses. (
bug 1409871 part 21, r?nical)
MozReview-Commit-ID: E2XejdUju9Q
--- a/gfx/layers/RotatedBuffer.h
+++ b/gfx/layers/RotatedBuffer.h
@@ -257,16 +257,23 @@ protected:
gfx::IntPoint mBufferRotation;
/**
* When this is true it means that all pixels have moved inside the buffer.
* It's not possible to sync with another buffer without a full copy.
*/
bool mDidSelfCopy;
};
+/**
+ * RemoteRotatedBuffer is a rotated buffer that is backed by texture
+ * clients. Before you use this class you must successfully lock it with
+ * an appropriate open mode, and then also unlock it when you're finished.
+ * RemoteRotatedBuffer is used by ContentClientSingleBuffered and
+ * ContentClientDoubleBuffered for the OMTC code path.
+ */
class RemoteRotatedBuffer : public RotatedBuffer
{
public:
RemoteRotatedBuffer(TextureClient* aClient, TextureClient* aClientOnWhite,
const gfx::IntRect& aBufferRect,
const gfx::IntPoint& aBufferRotation)
: RotatedBuffer(aBufferRect, aBufferRotation)
, mClient(aClient)
@@ -296,16 +303,20 @@ public:
private:
RefPtr<TextureClient> mClient;
RefPtr<TextureClient> mClientOnWhite;
RefPtr<gfx::DrawTarget> mTarget;
RefPtr<gfx::DrawTarget> mTargetOnWhite;
};
+/**
+ * DrawTargetRotatedBuffer is a rotated buffer that is backed by draw targets,
+ * and is used by ContentClientBasic for the on-mtc code path.
+ */
class DrawTargetRotatedBuffer : public RotatedBuffer
{
public:
DrawTargetRotatedBuffer(gfx::DrawTarget* aTarget, gfx::DrawTarget* aTargetOnWhite,
const gfx::IntRect& aBufferRect,
const gfx::IntPoint& aBufferRotation)
: RotatedBuffer(aBufferRect, aBufferRotation)
, mTarget(aTarget)
@@ -326,16 +337,20 @@ public:
virtual gfx::DrawTarget* GetDTBuffer() const override;
virtual gfx::DrawTarget* GetDTBufferOnWhite() const override;
private:
RefPtr<gfx::DrawTarget> mTarget;
RefPtr<gfx::DrawTarget> mTargetOnWhite;
};
+/**
+ * SourceRotatedBuffer is a rotated buffer that is backed by source surfaces,
+ * and may only be used to draw into other buffers or be read directly.
+ */
class SourceRotatedBuffer : public RotatedBuffer
{
public:
SourceRotatedBuffer(gfx::SourceSurface* aSource, gfx::SourceSurface* aSourceOnWhite,
const gfx::IntRect& aBufferRect,
const gfx::IntPoint& aBufferRotation)
: RotatedBuffer(aBufferRect, aBufferRotation)
, mSource(aSource)