Add documentation for the new rotated buffer subclasses. (bug 1409871 part 21, r?nical) draft
authorRyan Hunt <rhunt@eqrion.net>
Fri, 20 Oct 2017 12:48:20 -0400
changeset 684143 b9c86ec556e17a01d70c18e6ea5979ffc83ebc38
parent 684142 02e4a680898842f1a3fab90eac19408593da2ce1
child 684144 8431c6a7c40bea403850825461b252df92fe0378
push id85567
push userbmo:rhunt@eqrion.net
push dateFri, 20 Oct 2017 22:13:22 +0000
reviewersnical
bugs1409871
milestone58.0a1
Add documentation for the new rotated buffer subclasses. (bug 1409871 part 21, r?nical) MozReview-Commit-ID: E2XejdUju9Q
gfx/layers/RotatedBuffer.h
--- 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)