1 // 2 // Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved. 3 // Use of this source code is governed by a BSD-style license that can be 4 // found in the LICENSE file. 5 // 6 7 // Image.h: Defines the rx::Image class, an abstract base class for the 8 // renderer-specific classes which will define the interface to the underlying 9 // surfaces or resources. 10 11 #ifndef LIBGLESV2_RENDERER_IMAGE_H_ 12 #define LIBGLESV2_RENDERER_IMAGE_H_ 13 14 #include "common/debug.h" 15 16 #include <GLES2/gl2.h> 17 18 namespace gl 19 { 20 class Framebuffer; 21 } 22 23 namespace rx 24 { 25 26 class Renderer; 27 28 class Image 29 { 30 public: 31 Image(); ~Image()32 virtual ~Image() {}; 33 getWidth()34 GLsizei getWidth() const { return mWidth; } getHeight()35 GLsizei getHeight() const { return mHeight; } getDepth()36 GLsizei getDepth() const { return mDepth; } getInternalFormat()37 GLenum getInternalFormat() const { return mInternalFormat; } getActualFormat()38 GLenum getActualFormat() const { return mActualFormat; } getTarget()39 GLenum getTarget() const { return mTarget; } isRenderableFormat()40 bool isRenderableFormat() const { return mRenderable; } 41 markDirty()42 void markDirty() {mDirty = true;} markClean()43 void markClean() {mDirty = false;} 44 virtual bool isDirty() const = 0; 45 46 virtual bool redefine(Renderer *renderer, GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, bool forceRelease) = 0; 47 48 virtual void loadData(GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, 49 GLint unpackAlignment, GLenum type, const void *input) = 0; 50 virtual void loadCompressedData(GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, 51 const void *input) = 0; 52 53 virtual void copy(GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height, gl::Framebuffer *source) = 0; 54 55 protected: 56 GLsizei mWidth; 57 GLsizei mHeight; 58 GLsizei mDepth; 59 GLenum mInternalFormat; 60 GLenum mActualFormat; 61 bool mRenderable; 62 GLenum mTarget; 63 64 bool mDirty; 65 66 private: 67 DISALLOW_COPY_AND_ASSIGN(Image); 68 }; 69 70 } 71 72 #endif // LIBGLESV2_RENDERER_IMAGE_H_ 73