michael@0: /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef GFX_D2DSURFACE_H michael@0: #define GFX_D2DSURFACE_H michael@0: michael@0: #include "gfxASurface.h" michael@0: #include "nsPoint.h" michael@0: michael@0: #include michael@0: michael@0: struct ID3D10Texture2D; michael@0: struct nsIntRect; michael@0: michael@0: class gfxD2DSurface : public gfxASurface { michael@0: public: michael@0: michael@0: gfxD2DSurface(HWND wnd, michael@0: gfxContentType aContent); michael@0: michael@0: gfxD2DSurface(const gfxIntSize& size, michael@0: gfxImageFormat imageFormat = gfxImageFormat::RGB24); michael@0: michael@0: gfxD2DSurface(HANDLE handle, gfxContentType aContent); michael@0: michael@0: gfxD2DSurface(ID3D10Texture2D *texture, gfxContentType aContent); michael@0: michael@0: gfxD2DSurface(cairo_surface_t *csurf); michael@0: michael@0: void MovePixels(const nsIntRect& aSourceRect, michael@0: const nsIntPoint& aDestTopLeft) michael@0: { michael@0: FastMovePixels(aSourceRect, aDestTopLeft); michael@0: } michael@0: michael@0: virtual ~gfxD2DSurface(); michael@0: michael@0: void Present(); michael@0: void Scroll(const nsIntPoint &aDelta, const nsIntRect &aClip); michael@0: michael@0: virtual const gfxIntSize GetSize() const; michael@0: michael@0: ID3D10Texture2D *GetTexture(); michael@0: michael@0: HDC GetDC(bool aRetainContents); michael@0: void ReleaseDC(const nsIntRect *aUpdatedRect); michael@0: }; michael@0: michael@0: #endif /* GFX_D2DSURFACE_H */