Bug 1425820 - build fix of SetImageDataFromBackBuffer definition/call, r?jhorak draft
authorMartin Stransky <stransky@redhat.com>
Mon, 18 Dec 2017 11:53:30 +0100
changeset 712646 17db572868d091933a95f54dfecddbf7774f7963
parent 712645 5572465c08a9ce0671dcd01c721f9356fcd53a65
child 744095 59821e4c31be6912dd981a06adb0d4a37193656b
push id93382
push userstransky@redhat.com
push dateMon, 18 Dec 2017 10:54:00 +0000
reviewersjhorak
bugs1425820
milestone59.0a1
Bug 1425820 - build fix of SetImageDataFromBackBuffer definition/call, r?jhorak MozReview-Commit-ID: 7NJMCdhd400
widget/gtk/WindowSurfaceWayland.cpp
widget/gtk/WindowSurfaceWayland.h
--- a/widget/gtk/WindowSurfaceWayland.cpp
+++ b/widget/gtk/WindowSurfaceWayland.cpp
@@ -516,17 +516,17 @@ WindowBackBuffer::Detach()
 bool
 WindowBackBuffer::SetImageDataFromBackBuffer(
   class WindowBackBuffer* aSourceBuffer)
 {
   if (!IsMatchingSize(aSourceBuffer)) {
     Resize(aSourceBuffer->mWidth, aSourceBuffer->mHeight);
   }
 
-  mShmPool.SetImageDataFromPool(aSourceBuffer->mShmPool,
+  mShmPool.SetImageDataFromPool(&aSourceBuffer->mShmPool,
     aSourceBuffer->mWidth * aSourceBuffer->mHeight * BUFFER_BPP);
   return true;
 }
 
 already_AddRefed<gfx::DrawTarget>
 WindowBackBuffer::Lock(const LayoutDeviceIntRegion& aRegion)
 {
   gfx::IntRect bounds = aRegion.GetBounds().ToUnknownRect();
@@ -546,17 +546,17 @@ frame_callback_handler(void *data, struc
 }
 
 static const struct wl_callback_listener frame_listener = {
   frame_callback_handler
 };
 
 WindowSurfaceWayland::WindowSurfaceWayland(nsWindow *aWindow)
   : mWindow(aWindow)
-  , mWaylandDisplay(WaylandDisplayGet(aWidget->GetWaylandDisplay()))
+  , mWaylandDisplay(WaylandDisplayGet(aWindow->GetWaylandDisplay()))
   , mFrontBuffer(nullptr)
   , mBackBuffer(nullptr)
   , mFrameCallback(nullptr)
   , mFrameCallbackSurface(nullptr)
   , mDelayedCommit(false)
   , mFullScreenDamage(false)
   , mIsMainThread(NS_IsMainThread())
 {
@@ -610,17 +610,17 @@ WindowSurfaceWayland::GetBufferToDraw(in
   WindowBackBuffer *tmp = mFrontBuffer;
   mFrontBuffer = mBackBuffer;
   mBackBuffer = tmp;
 
   if (mBackBuffer->IsMatchingSize(aWidth, aHeight)) {
     // Former front buffer has the same size as a requested one.
     // Gecko may expect a content already drawn on screen so copy
     // existing data to the new buffer.
-    mFrontBuffer->Sync(mBackBuffer);
+    mFrontBuffer->SetImageDataFromBackBuffer(mBackBuffer);
     // When buffer switches we need to damage whole screen
     // (https://bugzilla.redhat.com/show_bug.cgi?id=1418260)
     mFullScreenDamage = true;
   } else {
     // Former buffer has different size from the new request. Only resize
     // the new buffer and leave gecko to render new whole content.
     mFrontBuffer->Resize(aWidth, aHeight);
   }
--- a/widget/gtk/WindowSurfaceWayland.h
+++ b/widget/gtk/WindowSurfaceWayland.h
@@ -43,17 +43,18 @@ private:
 class WaylandShmPool {
 public:
   WaylandShmPool(nsWaylandDisplay* aDisplay, int aSize);
   ~WaylandShmPool();
 
   bool                Resize(int aSize);
   wl_shm_pool*        GetShmPool()    { return mShmPool;   };
   void*               GetImageData()  { return mImageData; };
-  void                SetImageDataFromPool(class WaylandShmPool* aSourcePool);
+  void                SetImageDataFromPool(class WaylandShmPool* aSourcePool,
+                                           int aImageDataSize);
 
 private:
   int CreateTemporaryFile(int aSize);
 
   wl_shm_pool*        mShmPool;
   int                 mShmPoolFd;
   int                 mAllocatedSize;
   void*               mImageData;