Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/widget/gtk/WindowSurfaceX11Image.h
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
#ifndef _MOZILLA_WIDGET_GTK_WINDOW_SURFACE_X11_IMAGE_H
8
#define _MOZILLA_WIDGET_GTK_WINDOW_SURFACE_X11_IMAGE_H
9
10
#ifdef MOZ_X11
11
12
#include "WindowSurfaceX11.h"
13
#include "gfxXlibSurface.h"
14
#include "gfxImageSurface.h"
15
16
namespace mozilla {
17
namespace widget {
18
19
class WindowSurfaceX11Image : public WindowSurfaceX11 {
20
public:
21
  WindowSurfaceX11Image(Display* aDisplay, Window aWindow, Visual* aVisual,
22
                        unsigned int aDepth, bool aIsShaped);
23
  ~WindowSurfaceX11Image();
24
25
  already_AddRefed<gfx::DrawTarget> Lock(const LayoutDeviceIntRegion& aRegion) override;
26
  void Commit(const LayoutDeviceIntRegion& aInvalidRegion) override;
27
0
  bool IsFallback() const override { return true; }
28
29
private:
30
  void ResizeTransparencyBitmap(int aWidth, int aHeight);
31
  void ApplyTransparencyBitmap();
32
33
  RefPtr<gfxXlibSurface> mWindowSurface;
34
  RefPtr<gfxImageSurface> mImageSurface;
35
36
  gchar*  mTransparencyBitmap;
37
  int32_t mTransparencyBitmapWidth;
38
  int32_t mTransparencyBitmapHeight;
39
  bool    mIsShaped;
40
};
41
42
}  // namespace widget
43
}  // namespace mozilla
44
45
#endif // MOZ_X11
46
#endif // _MOZILLA_WIDGET_GTK_WINDOW_SURFACE_X11_IMAGE_H