gfx/gl/TextureImageCGL.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/gl/TextureImageCGL.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,66 @@
     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 TextureImageCGL_h_
    1.10 +#define TextureImageCGL_h_
    1.11 +
    1.12 +#include "GLTextureImage.h"
    1.13 +#include "GLContextTypes.h"
    1.14 +#include "nsAutoPtr.h"
    1.15 +#include "nsSize.h"
    1.16 +
    1.17 +class gfxASurface;
    1.18 +
    1.19 +namespace mozilla {
    1.20 +namespace gl {
    1.21 +
    1.22 +class TextureImageCGL : public BasicTextureImage
    1.23 +{
    1.24 +public:
    1.25 +
    1.26 +    TextureImageCGL(GLuint aTexture,
    1.27 +                    const nsIntSize& aSize,
    1.28 +                    GLenum aWrapMode,
    1.29 +                    ContentType aContentType,
    1.30 +                    GLContext* aContext,
    1.31 +                    TextureImage::Flags aFlags = TextureImage::NoFlags,
    1.32 +                    TextureImage::ImageFormat aImageFormat = gfxImageFormat::Unknown);
    1.33 +
    1.34 +    ~TextureImageCGL();
    1.35 +
    1.36 +protected:
    1.37 +    already_AddRefed<gfxASurface>
    1.38 +    GetSurfaceForUpdate(const gfxIntSize& aSize, ImageFormat aFmt);
    1.39 +
    1.40 +    bool FinishedSurfaceUpdate();
    1.41 +
    1.42 +    void FinishedSurfaceUpload();
    1.43 +
    1.44 +private:
    1.45 +
    1.46 +    GLuint mPixelBuffer;
    1.47 +    int32_t mPixelBufferSize;
    1.48 +    bool mBoundPixelBuffer;
    1.49 +};
    1.50 +
    1.51 +already_AddRefed<TextureImage>
    1.52 +CreateTextureImageCGL(GLContext *gl,
    1.53 +                      const gfx::IntSize& aSize,
    1.54 +                      TextureImage::ContentType aContentType,
    1.55 +                      GLenum aWrapMode,
    1.56 +                      TextureImage::Flags aFlags,
    1.57 +                      TextureImage::ImageFormat aImageFormat);
    1.58 +
    1.59 +already_AddRefed<TextureImage>
    1.60 +TileGenFuncCGL(GLContext *gl,
    1.61 +               const nsIntSize& aSize,
    1.62 +               TextureImage::ContentType aContentType,
    1.63 +               TextureImage::Flags aFlags,
    1.64 +               TextureImage::ImageFormat aImageFormat);
    1.65 +
    1.66 +}
    1.67 +}
    1.68 +
    1.69 +#endif

mercurial