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 TextureImageCGL_h_ michael@0: #define TextureImageCGL_h_ michael@0: michael@0: #include "GLTextureImage.h" michael@0: #include "GLContextTypes.h" michael@0: #include "nsAutoPtr.h" michael@0: #include "nsSize.h" michael@0: michael@0: class gfxASurface; michael@0: michael@0: namespace mozilla { michael@0: namespace gl { michael@0: michael@0: class TextureImageCGL : public BasicTextureImage michael@0: { michael@0: public: michael@0: michael@0: TextureImageCGL(GLuint aTexture, michael@0: const nsIntSize& aSize, michael@0: GLenum aWrapMode, michael@0: ContentType aContentType, michael@0: GLContext* aContext, michael@0: TextureImage::Flags aFlags = TextureImage::NoFlags, michael@0: TextureImage::ImageFormat aImageFormat = gfxImageFormat::Unknown); michael@0: michael@0: ~TextureImageCGL(); michael@0: michael@0: protected: michael@0: already_AddRefed michael@0: GetSurfaceForUpdate(const gfxIntSize& aSize, ImageFormat aFmt); michael@0: michael@0: bool FinishedSurfaceUpdate(); michael@0: michael@0: void FinishedSurfaceUpload(); michael@0: michael@0: private: michael@0: michael@0: GLuint mPixelBuffer; michael@0: int32_t mPixelBufferSize; michael@0: bool mBoundPixelBuffer; michael@0: }; michael@0: michael@0: already_AddRefed michael@0: CreateTextureImageCGL(GLContext *gl, michael@0: const gfx::IntSize& aSize, michael@0: TextureImage::ContentType aContentType, michael@0: GLenum aWrapMode, michael@0: TextureImage::Flags aFlags, michael@0: TextureImage::ImageFormat aImageFormat); michael@0: michael@0: already_AddRefed michael@0: TileGenFuncCGL(GLContext *gl, michael@0: const nsIntSize& aSize, michael@0: TextureImage::ContentType aContentType, michael@0: TextureImage::Flags aFlags, michael@0: TextureImage::ImageFormat aImageFormat); michael@0: michael@0: } michael@0: } michael@0: michael@0: #endif