Bug 1425820 - build fix of SetImageDataFromBackBuffer definition/call, r?jhorak
MozReview-Commit-ID: 7NJMCdhd400
--- 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;