widget/WindowSurfaceX11SHM.h
author Sylvestre Ledru <sledru@mozilla.com>
Fri, 24 Feb 2017 09:55:59 +0100
changeset 489668 cbb8fdf1daf98a15f7d57f6b08d273bdf96aa1a0
parent 387839 586815d86b50e44a1cc48c734c4da6efcd8ae8ff
child 489671 05d9746016f47666c00390aacc9f9d62c8ffffb4
permissions -rw-r--r--
indent all but js/ MozReview-Commit-ID: 4rriqT7lBP9

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef _MOZILLA_WIDGET_WINDOW_SURFACE_X11_SHM_H
#define _MOZILLA_WIDGET_WINDOW_SURFACE_X11_SHM_H

#ifdef MOZ_X11

#include "mozilla/widget/WindowSurface.h"
#include "nsShmImage.h"

namespace mozilla {
namespace widget {

class WindowSurfaceX11SHM : public WindowSurface
{
public:
  WindowSurfaceX11SHM(Display* aDisplay,
                      Drawable aWindow,
                      Visual* aVisual,
                      unsigned int aDepth);

  already_AddRefed<gfx::DrawTarget> Lock(
    const LayoutDeviceIntRegion& aRegion) override;
  void Commit(const LayoutDeviceIntRegion& aInvalidRegion) override;

private:
  RefPtr<nsShmImage> mFrontImage;
  RefPtr<nsShmImage> mBackImage;
};

} // namespace widget
} // namespace mozilla

#endif // MOZ_X11
#endif // _MOZILLA_WIDGET_WINDOW_SURFACE_X11_SHM_H