Source code

Revision control

Other Tools

1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2
*
3
* This Source Code Form is subject to the terms of the Mozilla Public
4
* License, v. 2.0. If a copy of the MPL was not distributed with this
5
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
#include "WindowSurfaceX11SHM.h"
8
9
namespace mozilla {
10
namespace widget {
11
12
WindowSurfaceX11SHM::WindowSurfaceX11SHM(Display* aDisplay, Drawable aWindow,
13
Visual* aVisual, unsigned int aDepth) {
14
mFrontImage = new nsShmImage(aDisplay, aWindow, aVisual, aDepth);
15
mBackImage = new nsShmImage(aDisplay, aWindow, aVisual, aDepth);
16
}
17
18
already_AddRefed<gfx::DrawTarget> WindowSurfaceX11SHM::Lock(
19
const LayoutDeviceIntRegion& aRegion) {
20
mBackImage.swap(mFrontImage);
21
return mBackImage->CreateDrawTarget(aRegion);
22
}
23
24
void WindowSurfaceX11SHM::Commit(const LayoutDeviceIntRegion& aInvalidRegion) {
25
mBackImage->Put(aInvalidRegion);
26
}
27
28
} // namespace widget
29
} // namespace mozilla