Update comment for SFEResult. draft
authorJeff Gilbert <jdashg@gmail.com>
Thu, 17 Dec 2015 16:16:55 -0800
changeset 316114 09930b4d17d4de04d36a2010ad4310aeb4d9da95
parent 316113 c4ba968014028455a903b6cd16c181fece6c6c35
child 316115 eafcf3d846aae6ab8f7b3ca5aa768aae61176f35
push id8514
push userjgilbert@mozilla.com
push dateFri, 18 Dec 2015 00:24:33 +0000
milestone45.0a1
Update comment for SFEResult.
layout/base/nsLayoutUtils.h
--- a/layout/base/nsLayoutUtils.h
+++ b/layout/base/nsLayoutUtils.h
@@ -2096,21 +2096,29 @@ public:
     /* imgIContainer flags to use when drawing */
     uint32_t mDrawingFlags;
   };
 
   struct SurfaceFromElementResult {
     friend class mozilla::dom::CanvasRenderingContext2D;
     friend class nsLayoutUtils;
 
+    /* If SFEResult contains a valid surface, it either mLayersImage or mSourceSurface
+     * will be non-null, and GetSourceSurface() will not be null.
+     *
+     * For valid surfaces, mSourceSurface may be null if mLayersImage is non-null, but
+     * GetSourceSurface() will create mSourceSurface from mLayersImage when called.
+     */
+
     /* Video elements (at least) often are already decoded as layers::Images. */
     RefPtr<mozilla::layers::Image> mLayersImage;
 
 protected:
-    /* mSourceSurface will contain the resulting surface, or will be nullptr on error */
+    /* GetSourceSurface() fills this and returns its non-null value if this SFEResult
+     * was successful. */
     RefPtr<mozilla::gfx::SourceSurface> mSourceSurface;
 
 public:
     /* Contains info for drawing when there is no mSourceSurface. */
     DirectDrawInfo mDrawInfo;
 
     /* The size of the surface */
     mozilla::gfx::IntSize mSize;