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. */
15 struct IDirect3DSurface9
;
17 /* undefine LoadImage because our code uses that name */
22 class gfxWindowsSurface
: public gfxASurface
{
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();
41 already_AddRefed
<gfxImageSurface
> GetAsImageSurface();
43 const mozilla::gfx::IntSize
GetSize() const;
46 void MakeInvalid(mozilla::gfx::IntSize
& size
);
54 #endif /* GFX_WINDOWSSURFACE_H */