Line data Source code
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 1 : WindowSurfaceX11SHM::WindowSurfaceX11SHM(Display* aDisplay, Drawable aWindow,
13 1 : Visual* aVisual, unsigned int aDepth)
14 : {
15 1 : mFrontImage = new nsShmImage(aDisplay, aWindow, aVisual, aDepth);
16 1 : mBackImage = new nsShmImage(aDisplay, aWindow, aVisual, aDepth);
17 1 : }
18 :
19 : already_AddRefed<gfx::DrawTarget>
20 27 : WindowSurfaceX11SHM::Lock(const LayoutDeviceIntRegion& aRegion)
21 : {
22 27 : mBackImage.swap(mFrontImage);
23 27 : return mBackImage->CreateDrawTarget(aRegion);
24 : }
25 :
26 : void
27 27 : WindowSurfaceX11SHM::Commit(const LayoutDeviceIntRegion& aInvalidRegion)
28 : {
29 27 : mBackImage->Put(aInvalidRegion);
30 27 : }
31 :
32 : } // namespace widget
33 : } // namespace mozilla
|