author Gregory Szorc <>
Tue, 24 Sep 2013 15:05:43 -0700
changeset 162321 b51710e0e485a5c4edccd438ddb2a46bd7f0e91f
parent 162307 1892aa2a6de84d83a3c0aff80b0153d925e48ebc
child 180947 cfecc1e799529437cf2657d0d0ff87617d6ef6df
permissions -rw-r--r--
Bug 901990 - Part 3: Don't purge _tests during PGO builds; r=glandium CLOSED TREE

/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at */


#include "gfxASurface.h"
#include "nsPoint.h"

#include <windows.h>

struct ID3D10Texture2D;
struct nsIntRect;

class gfxD2DSurface : public gfxASurface {

    gfxD2DSurface(HWND wnd,
                  gfxContentType aContent);

    gfxD2DSurface(const gfxIntSize& size,
                  gfxImageFormat imageFormat = gfxImageFormatRGB24);

    gfxD2DSurface(HANDLE handle, gfxContentType aContent);

    gfxD2DSurface(ID3D10Texture2D *texture, gfxContentType aContent);

    gfxD2DSurface(cairo_surface_t *csurf);

    void MovePixels(const nsIntRect& aSourceRect,
                    const nsIntPoint& aDestTopLeft)
        FastMovePixels(aSourceRect, aDestTopLeft);

    virtual ~gfxD2DSurface();

    void Present();
    void Scroll(const nsIntPoint &aDelta, const nsIntRect &aClip);

    virtual const gfxIntSize GetSize() const;

    ID3D10Texture2D *GetTexture();

    HDC GetDC(bool aRetainContents);
    void ReleaseDC(const nsIntRect *aUpdatedRect);

#endif /* GFX_D2DSURFACE_H */