bug 604533 - Tearing/Shearing while panning on local pages/error console in Fennec r=cjones,roc a=blocking-fennec
authorBrad Lassey <blassey@mozilla.com>
Tue, 23 Nov 2010 22:04:58 -0500
changeset 58123 9c3babe383e147c4ec8e1fb11462fd0425d49c42
parent 58122 4deec1586536fe0773aab091b4c259b3d0d753a7
child 58124 64c4716a72dd8d53e09b25b99c3540c8b98caaeb
push id17167
push userblassey@mozilla.com
push dateWed, 24 Nov 2010 03:15:40 +0000
treeherdermozilla-central@9c3babe383e1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscjones, roc, blocking-fennec
bugs604533
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 604533 - Tearing/Shearing while panning on local pages/error console in Fennec r=cjones,roc a=blocking-fennec
gfx/layers/ThebesLayerBuffer.cpp
gfx/thebes/gfxASurface.h
gfx/thebes/gfxImageSurface.h
--- a/gfx/layers/ThebesLayerBuffer.cpp
+++ b/gfx/layers/ThebesLayerBuffer.cpp
@@ -241,17 +241,17 @@ ThebesLayerBuffer::BeginPaint(ThebesLaye
       NS_ASSERTION(nsIntRect(nsIntPoint(0,0), mBufferRect.Size()).Contains(newRotation),
                    "newRotation out of bounds");
       PRInt32 xBoundary = destBufferRect.XMost() - newRotation.x;
       PRInt32 yBoundary = destBufferRect.YMost() - newRotation.y;
       if ((drawBounds.x < xBoundary && xBoundary < drawBounds.XMost()) ||
           (drawBounds.y < yBoundary && yBoundary < drawBounds.YMost())) {
         // The stuff we need to redraw will wrap around an edge of the
         // buffer, so we will need to do a self-copy
-        if (mBufferRotation == nsIntPoint(0,0)) {
+        if (mBuffer->SupportsSelfCopy() && mBufferRotation == nsIntPoint(0,0)) {
           destBuffer = mBuffer;
         } else {
           // We can't do a real self-copy because the buffer is rotated.
           // So allocate a new buffer for the destination.
           destBufferRect = visibleBounds;
           destBufferDims = ScaledSize(destBufferRect.Size(),
                                       aXResolution, aYResolution);
           bufferDimsChanged = PR_TRUE;
--- a/gfx/thebes/gfxASurface.h
+++ b/gfx/thebes/gfxASurface.h
@@ -228,16 +228,18 @@ public:
     void RecordMemoryFreed();
 
     PRInt32 KnownMemoryUsed() { return mBytesRecorded; }
 
     static PRInt32 BytePerPixelFromFormat(gfxImageFormat format);
 
     virtual const gfxIntSize GetSize() const { return gfxIntSize(-1, -1); }
 
+    virtual PRBool SupportsSelfCopy() { return PR_TRUE; }
+
 protected:
     gfxASurface() : mSurface(nsnull), mFloatingRefs(0), mBytesRecorded(0), mSurfaceValid(PR_FALSE)
     {
         MOZ_COUNT_CTOR(gfxASurface);
     }
 
     static gfxASurface* GetSurfaceWrapper(cairo_surface_t *csurf);
     static void SetSurfaceWrapper(cairo_surface_t *csurf, gfxASurface *asurf);
--- a/gfx/thebes/gfxImageSurface.h
+++ b/gfx/thebes/gfxImageSurface.h
@@ -103,16 +103,18 @@ public:
 
     /* return new Subimage with pointing to original image starting from aRect.pos
      * and size of aRect.size. New subimage keeping current image reference
      */
     already_AddRefed<gfxSubimageSurface> GetSubimage(const gfxRect& aRect);
 
     virtual already_AddRefed<gfxImageSurface> GetAsImageSurface();
 
+    virtual PRBool SupportsSelfCopy() { return PR_FALSE; }
+
 protected:
     gfxImageSurface();
     void InitWithData(unsigned char *aData, const gfxIntSize& aSize,
                       long aStride, gfxImageFormat aFormat);
     void InitFromSurface(cairo_surface_t *csurf);
     long ComputeStride() const;
 
     gfxIntSize mSize;