1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/thebes/gfxD2DSurface.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,51 @@ 1.4 +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- 1.5 + * This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef GFX_D2DSURFACE_H 1.10 +#define GFX_D2DSURFACE_H 1.11 + 1.12 +#include "gfxASurface.h" 1.13 +#include "nsPoint.h" 1.14 + 1.15 +#include <windows.h> 1.16 + 1.17 +struct ID3D10Texture2D; 1.18 +struct nsIntRect; 1.19 + 1.20 +class gfxD2DSurface : public gfxASurface { 1.21 +public: 1.22 + 1.23 + gfxD2DSurface(HWND wnd, 1.24 + gfxContentType aContent); 1.25 + 1.26 + gfxD2DSurface(const gfxIntSize& size, 1.27 + gfxImageFormat imageFormat = gfxImageFormat::RGB24); 1.28 + 1.29 + gfxD2DSurface(HANDLE handle, gfxContentType aContent); 1.30 + 1.31 + gfxD2DSurface(ID3D10Texture2D *texture, gfxContentType aContent); 1.32 + 1.33 + gfxD2DSurface(cairo_surface_t *csurf); 1.34 + 1.35 + void MovePixels(const nsIntRect& aSourceRect, 1.36 + const nsIntPoint& aDestTopLeft) 1.37 + { 1.38 + FastMovePixels(aSourceRect, aDestTopLeft); 1.39 + } 1.40 + 1.41 + virtual ~gfxD2DSurface(); 1.42 + 1.43 + void Present(); 1.44 + void Scroll(const nsIntPoint &aDelta, const nsIntRect &aClip); 1.45 + 1.46 + virtual const gfxIntSize GetSize() const; 1.47 + 1.48 + ID3D10Texture2D *GetTexture(); 1.49 + 1.50 + HDC GetDC(bool aRetainContents); 1.51 + void ReleaseDC(const nsIntRect *aUpdatedRect); 1.52 +}; 1.53 + 1.54 +#endif /* GFX_D2DSURFACE_H */