Bug 1839315: part 4) Link from `SheetLoadData::mWasAlternate` to spec. r=emilio DONTBUILD
[gecko.git] / gfx / thebes / gfxWindowsSurface.h
blob3659cab37c9a9e3af6009b01c88e07b8c6cc2690
1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef GFX_WINDOWSSURFACE_H
7 #define GFX_WINDOWSSURFACE_H
9 #include "gfxASurface.h"
10 #include "gfxImageSurface.h"
12 /* include windows.h for the HWND and HDC definitions that we need. */
13 #include <windows.h>
15 struct IDirect3DSurface9;
17 /* undefine LoadImage because our code uses that name */
18 #undef LoadImage
20 class gfxContext;
22 class gfxWindowsSurface : public gfxASurface {
23 public:
24 enum { FLAG_IS_TRANSPARENT = (1 << 2) };
26 explicit gfxWindowsSurface(HDC dc, uint32_t flags = 0);
28 // Create a DIB surface
29 explicit gfxWindowsSurface(const mozilla::gfx::IntSize& size,
30 gfxImageFormat imageFormat =
31 mozilla::gfx::SurfaceFormat::X8R8G8B8_UINT32);
33 explicit gfxWindowsSurface(cairo_surface_t* csurf);
35 void InitWithDC(uint32_t flags);
37 virtual ~gfxWindowsSurface();
39 HDC GetDC();
41 already_AddRefed<gfxImageSurface> GetAsImageSurface();
43 const mozilla::gfx::IntSize GetSize() const;
45 private:
46 void MakeInvalid(mozilla::gfx::IntSize& size);
48 bool mOwnsDC;
50 HDC mDC;
51 HWND mWnd;
54 #endif /* GFX_WINDOWSSURFACE_H */