/src/mozilla-central/widget/WindowSurfaceX11SHM.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
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 | 0 | { |
15 | 0 | mFrontImage = new nsShmImage(aDisplay, aWindow, aVisual, aDepth); |
16 | 0 | mBackImage = new nsShmImage(aDisplay, aWindow, aVisual, aDepth); |
17 | 0 | } |
18 | | |
19 | | already_AddRefed<gfx::DrawTarget> |
20 | | WindowSurfaceX11SHM::Lock(const LayoutDeviceIntRegion& aRegion) |
21 | 0 | { |
22 | 0 | mBackImage.swap(mFrontImage); |
23 | 0 | return mBackImage->CreateDrawTarget(aRegion); |
24 | 0 | } |
25 | | |
26 | | void |
27 | | WindowSurfaceX11SHM::Commit(const LayoutDeviceIntRegion& aInvalidRegion) |
28 | 0 | { |
29 | 0 | mBackImage->Put(aInvalidRegion); |
30 | 0 | } |
31 | | |
32 | | } // namespace widget |
33 | | } // namespace mozilla |