bug 674373 pt 2 - consistently use client bounds for layer sizing. r=roc
authorJonathan Kew <jkew@mozilla.com>
Sat, 29 Sep 2012 12:34:41 +0100
changeset 108732 8d715c5958385ef03ab775a068635a09f39686a9
parent 108731 66bc6ceca2f34b2054edf6d18a2a104ad39deee5
child 108733 466d49964ff1084d25487b811989272813450d79
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
reviewersroc
bugs674373
milestone18.0a1
bug 674373 pt 2 - consistently use client bounds for layer sizing. r=roc
gfx/layers/ipc/CompositorParent.cpp
gfx/layers/opengl/LayerManagerOGL.cpp
--- a/gfx/layers/ipc/CompositorParent.cpp
+++ b/gfx/layers/ipc/CompositorParent.cpp
@@ -940,17 +940,17 @@ CompositorParent::AllocPLayers(const Lay
                                LayersBackend* aBackend,
                                int32_t* aMaxTextureSize)
 {
   MOZ_ASSERT(aId == 0);
 
   // mWidget doesn't belong to the compositor thread, so it should be set to
   // NULL before returning from this method, to avoid accessing it elsewhere.
   nsIntRect rect;
-  mWidget->GetBounds(rect);
+  mWidget->GetClientBounds(rect);
   mWidgetSize.width = rect.width;
   mWidgetSize.height = rect.height;
 
   *aBackend = aBackendHint;
 
   if (aBackendHint == mozilla::layers::LAYERS_OPENGL) {
     nsRefPtr<LayerManagerOGL> layerManager;
     layerManager =
--- a/gfx/layers/opengl/LayerManagerOGL.cpp
+++ b/gfx/layers/opengl/LayerManagerOGL.cpp
@@ -940,17 +940,17 @@ LayerManagerOGL::Render()
   mWidget->DrawWindowOverlay(this, rect);
 
 #ifdef MOZ_DUMP_PAINTING
   if (gfxUtils::sDumpPainting) {
     nsIntRect rect;
     if (mIsRenderingToEGLSurface) {
       rect = nsIntRect(0, 0, mSurfaceSize.width, mSurfaceSize.height);
     } else {
-      mWidget->GetBounds(rect);
+      mWidget->GetClientBounds(rect);
     }
     nsRefPtr<gfxASurface> surf = gfxPlatform::GetPlatform()->CreateOffscreenSurface(rect.Size(), gfxASurface::CONTENT_COLOR_ALPHA);
     nsRefPtr<gfxContext> ctx = new gfxContext(surf);
     CopyToTarget(ctx);
 
     WriteSnapshotToDumpFile(this, surf);
   }
 #endif
@@ -1175,17 +1175,17 @@ LayerManagerOGL::SetupBackBuffer(int aWi
 
 void
 LayerManagerOGL::CopyToTarget(gfxContext *aTarget)
 {
   nsIntRect rect;
   if (mIsRenderingToEGLSurface) {
     rect = nsIntRect(0, 0, mSurfaceSize.width, mSurfaceSize.height);
   } else {
-    mWidget->GetBounds(rect);
+    mWidget->GetClientBounds(rect);
   }
   GLint width = rect.width;
   GLint height = rect.height;
 
   if ((int64_t(width) * int64_t(height) * int64_t(4)) > INT32_MAX) {
     NS_ERROR("Widget size too big - integer overflow!");
     return;
   }