Bug 948221 - Part 2: Remove SFE_WANT_NEW_SURFACE since it's never used. r=roc
authorMatt Woodrow <mwoodrow@mozilla.com>
Wed, 27 Nov 2013 14:05:02 +1300
changeset 159995 c13412051f524172b096b138228246b9cf48bb0b
parent 159994 e2a8de576daf9edd9138da4d6deb5c5b9228d42d
child 159996 7b0f7f3dfa8e625a902c946efaa4f4bde2d63755
push id25821
push usercbook@mozilla.com
push dateThu, 12 Dec 2013 11:53:39 +0000
treeherdermozilla-central@d15ed5648a5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs948221
milestone29.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 948221 - Part 2: Remove SFE_WANT_NEW_SURFACE since it's never used. r=roc
content/canvas/src/CanvasRenderingContext2D.cpp
layout/base/nsLayoutUtils.cpp
layout/base/nsLayoutUtils.h
--- a/content/canvas/src/CanvasRenderingContext2D.cpp
+++ b/content/canvas/src/CanvasRenderingContext2D.cpp
@@ -1449,17 +1449,17 @@ CanvasRenderingContext2D::CreatePattern(
   } else {
     htmlElement = &element.GetAsHTMLVideoElement();
   }
 
   // The canvas spec says that createPattern should use the first frame
   // of animated images
   nsLayoutUtils::SurfaceFromElementResult res =
     nsLayoutUtils::SurfaceFromElement(htmlElement,
-      nsLayoutUtils::SFE_WANT_FIRST_FRAME | nsLayoutUtils::SFE_WANT_NEW_SURFACE);
+      nsLayoutUtils::SFE_WANT_FIRST_FRAME);
 
   if (!res.mSurface) {
     error.Throw(NS_ERROR_NOT_AVAILABLE);
     return nullptr;
   }
 
   // Ignore nullptr cairo surfaces! See bug 666312.
   if (!res.mSurface->CairoSurface() || res.mSurface->CairoStatus()) {
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -4757,17 +4757,17 @@ nsLayoutUtils::IsReallyFixedPos(nsIFrame
 
 nsLayoutUtils::SurfaceFromElementResult
 nsLayoutUtils::SurfaceFromElement(nsIImageLoadingContent* aElement,
                                   uint32_t aSurfaceFlags)
 {
   SurfaceFromElementResult result;
   nsresult rv;
 
-  bool forceCopy = (aSurfaceFlags & SFE_WANT_NEW_SURFACE) != 0;
+  bool forceCopy = false;
   bool wantImageSurface = (aSurfaceFlags & SFE_WANT_IMAGE_SURFACE) != 0;
   bool premultAlpha = (aSurfaceFlags & SFE_NO_PREMULTIPLY_ALPHA) == 0;
 
   if (!premultAlpha) {
     forceCopy = true;
     wantImageSurface = true;
   }
 
@@ -4869,17 +4869,17 @@ nsLayoutUtils::SurfaceFromElement(HTMLIm
 
 nsLayoutUtils::SurfaceFromElementResult
 nsLayoutUtils::SurfaceFromElement(HTMLCanvasElement* aElement,
                                   uint32_t aSurfaceFlags)
 {
   SurfaceFromElementResult result;
   nsresult rv;
 
-  bool forceCopy = (aSurfaceFlags & SFE_WANT_NEW_SURFACE) != 0;
+  bool forceCopy = false;
   bool wantImageSurface = (aSurfaceFlags & SFE_WANT_IMAGE_SURFACE) != 0;
   bool premultAlpha = (aSurfaceFlags & SFE_NO_PREMULTIPLY_ALPHA) == 0;
 
   if (!premultAlpha) {
     forceCopy = true;
     wantImageSurface = true;
   }
 
--- a/layout/base/nsLayoutUtils.h
+++ b/layout/base/nsLayoutUtils.h
@@ -1541,29 +1541,27 @@ public:
    *  - HTML Video elements: will return the current video frame
    *  - Image elements: will return the image
    *
    * The above results are modified by the below flags (copying,
    * forcing image surface, etc.).
    */
 
   enum {
-    /* Always create a new surface for the result */
-    SFE_WANT_NEW_SURFACE   = 1 << 0,
     /* When creating a new surface, create an image surface */
-    SFE_WANT_IMAGE_SURFACE = 1 << 1,
+    SFE_WANT_IMAGE_SURFACE = 1 << 0,
     /* Whether to extract the first frame (as opposed to the
        current frame) in the case that the element is an image. */
-    SFE_WANT_FIRST_FRAME = 1 << 2,
+    SFE_WANT_FIRST_FRAME = 1 << 1,
     /* Whether we should skip colorspace/gamma conversion */
-    SFE_NO_COLORSPACE_CONVERSION = 1 << 3,
+    SFE_NO_COLORSPACE_CONVERSION = 1 << 2,
     /* Whether we should skip premultiplication -- the resulting
        image will always be an image surface, and must not be given to
        Thebes for compositing! */
-    SFE_NO_PREMULTIPLY_ALPHA = 1 << 4
+    SFE_NO_PREMULTIPLY_ALPHA = 1 << 3
   };
 
   struct SurfaceFromElementResult {
     SurfaceFromElementResult();
 
     /* mSurface will contain the resulting surface, or will be nullptr on error */
     nsRefPtr<gfxASurface> mSurface;
     /* The size of the surface */