Bug 579985. Part 3.2: Remove gfxASurface::AreSimilarSurfacesSensitiveToContentType because it's effectively always true now. r=jrmuizel,a=blocking
authorRobert O'Callahan <robert@ocallahan.org>
Fri, 12 Nov 2010 14:43:40 +1300
changeset 57383 aacc4ca15cade8ea12e95ad8ff79de6deb819351
parent 57382 b58d66cea46e22e4c45730b196a99c7d7dc3a603
child 57384 19744c96dffdd196f29db00e07d4676510e9cfba
push idunknown
push userunknown
push dateunknown
reviewersjrmuizel, blocking
bugs579985
milestone2.0b8pre
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 579985. Part 3.2: Remove gfxASurface::AreSimilarSurfacesSensitiveToContentType because it's effectively always true now. r=jrmuizel,a=blocking
gfx/layers/basic/BasicLayers.cpp
gfx/thebes/gfxASurface.h
gfx/thebes/gfxCachedTempSurface.cpp
gfx/thebes/gfxQuartzSurface.h
--- a/gfx/layers/basic/BasicLayers.cpp
+++ b/gfx/layers/basic/BasicLayers.cpp
@@ -467,21 +467,19 @@ BasicThebesLayer::Paint(gfxContext* aCon
 {
   NS_ASSERTION(BasicManager()->InDrawing(),
                "Can only draw in drawing phase");
   gfxContext* target = BasicManager()->GetTarget();
   NS_ASSERTION(target, "We shouldn't be called if there's no target");
   nsRefPtr<gfxASurface> targetSurface = aContext->CurrentSurface();
 
   PRBool canUseOpaqueSurface = CanUseOpaqueSurface();
-  PRBool opaqueBuffer = canUseOpaqueSurface &&
-    targetSurface->AreSimilarSurfacesSensitiveToContentType();
   Buffer::ContentType contentType =
-    opaqueBuffer ? gfxASurface::CONTENT_COLOR :
-                   gfxASurface::CONTENT_COLOR_ALPHA;
+    canUseOpaqueSurface ? gfxASurface::CONTENT_COLOR :
+                          gfxASurface::CONTENT_COLOR_ALPHA;
   float opacity = GetEffectiveOpacity();
 
   if (!BasicManager()->IsRetained() ||
       (opacity == 1.0 && !canUseOpaqueSurface &&
        !ShouldRetainTransparentSurface(mContentFlags, targetSurface) &&
        !MustRetainContent())) {
     mValidRegion.SetEmpty();
     mBuffer.Clear();
--- a/gfx/thebes/gfxASurface.h
+++ b/gfx/thebes/gfxASurface.h
@@ -156,30 +156,16 @@ public:
      * This will not copy image data, just wraps an image surface around
      * pixel data already available in memory.
      */
     virtual already_AddRefed<gfxImageSurface> GetAsImageSurface()
     {
       return nsnull;
     }
 
-    /**
-     * Return trues if offscreen surfaces created from this surface
-     * would behave differently depending on the gfxContentType. Returns
-     * false if they don't (i.e. the surface returned by
-     * CreateOffscreenSurface is always as if you passed
-     * CONTENT_COLOR_ALPHA). Knowing this can be useful to avoid
-     * recreating a surface just because it changed from opaque to
-     * transparent.
-     */
-    virtual PRBool AreSimilarSurfacesSensitiveToContentType()
-    {
-        return PR_TRUE;
-    }
-
     enum TextQuality {
         /**
          * TEXT_QUALITY_OK means that text is always rendered to a
          * transparent surface just as well as it would be rendered to an
          * opaque surface. This would normally only be true if
          * subpixel antialiasing is disabled or if the platform's
          * transparent surfaces support component alpha.
          */
--- a/gfx/thebes/gfxCachedTempSurface.cpp
+++ b/gfx/thebes/gfxCachedTempSurface.cpp
@@ -99,18 +99,17 @@ gfxCachedTempSurface::~gfxCachedTempSurf
 already_AddRefed<gfxContext>
 gfxCachedTempSurface::Get(gfxASurface::gfxContentType aContentType,
                           const gfxIntSize& aSize,
                           gfxASurface* aSimilarTo)
 {
   if (mSurface) {
     /* Verify the current buffer is valid for this purpose */
     if (mSize.width < aSize.width || mSize.height < aSize.height
-        || (mSurface->GetContentType() != aContentType
-            && mSurface->AreSimilarSurfacesSensitiveToContentType())) {
+        || mSurface->GetContentType() != aContentType) {
       mSurface = nsnull;
     } else {
       NS_ASSERTION(mType == aSimilarTo->GetType(),
                    "Unexpected surface type change");
     }
   }
 
   PRBool cleared = PR_FALSE;
--- a/gfx/thebes/gfxQuartzSurface.h
+++ b/gfx/thebes/gfxQuartzSurface.h
@@ -51,20 +51,16 @@ public:
     gfxQuartzSurface(const gfxSize& size, gfxImageFormat format, PRBool aForPrinting = PR_FALSE);
     gfxQuartzSurface(CGContextRef context, const gfxSize& size, PRBool aForPrinting = PR_FALSE);
     gfxQuartzSurface(cairo_surface_t *csurf, PRBool aForPrinting = PR_FALSE);
 
     virtual ~gfxQuartzSurface();
 
     virtual already_AddRefed<gfxASurface> CreateSimilarSurface(gfxContentType aType,
                                                                const gfxIntSize& aSize);
-    virtual PRBool AreSimilarSurfacesSensitiveToContentType()
-    {
-      return PR_FALSE;
-    }
     virtual TextQuality GetTextQualityInTransparentSurfaces()
     {
       return TEXT_QUALITY_OK_OVER_OPAQUE_PIXELS;
     }
 
     virtual const gfxIntSize GetSize() const { return gfxIntSize(mSize.width, mSize.height); }
 
     CGContextRef GetCGContext() { return mCGContext; }