blob: 8fcffa4309deb312bbc4d5902ca2ffbab383a96a [file] [log] [blame]
daniel@transgaming.comb9d7e6f2012-10-31 19:08:32 +00001//
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
daniel@transgaming.com4ba24062012-12-20 20:54:24 +00007// 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.
daniel@transgaming.comb9d7e6f2012-10-31 19:08:32 +000010
11#ifndef LIBGLESV2_RENDERER_IMAGE_H_
12#define LIBGLESV2_RENDERER_IMAGE_H_
13
daniel@transgaming.comb9d7e6f2012-10-31 19:08:32 +000014#include "common/debug.h"
15
daniel@transgaming.com31b13e12012-11-28 19:34:30 +000016namespace gl
17{
18class Framebuffer;
19}
20
daniel@transgaming.coma9571682012-11-28 19:33:08 +000021namespace rx
22{
Brandon Jones6518fe22014-07-08 15:16:52 -070023
daniel@transgaming.comc5c806d2012-12-20 20:52:53 +000024class Renderer;
daniel@transgaming.com0f195ad2012-10-31 19:51:59 +000025
daniel@transgaming.comb9d7e6f2012-10-31 19:08:32 +000026class Image
27{
28 public:
29 Image();
daniel@transgaming.com4ba24062012-12-20 20:54:24 +000030 virtual ~Image() {};
daniel@transgaming.comb9d7e6f2012-10-31 19:08:32 +000031
daniel@transgaming.com4ba24062012-12-20 20:54:24 +000032 GLsizei getWidth() const { return mWidth; }
33 GLsizei getHeight() const { return mHeight; }
shannon.woods%transgaming.com@gtempaccount.com4760c562013-04-13 03:42:30 +000034 GLsizei getDepth() const { return mDepth; }
daniel@transgaming.com4ba24062012-12-20 20:54:24 +000035 GLenum getInternalFormat() const { return mInternalFormat; }
36 GLenum getActualFormat() const { return mActualFormat; }
shannon.woods%transgaming.com@gtempaccount.com56074f32013-04-13 03:45:30 +000037 GLenum getTarget() const { return mTarget; }
shannonwoods@chromium.org803be0a2013-05-30 00:08:59 +000038 bool isRenderableFormat() const { return mRenderable; }
daniel@transgaming.comb9d7e6f2012-10-31 19:08:32 +000039
daniel@transgaming.comb9d7e6f2012-10-31 19:08:32 +000040 void markDirty() {mDirty = true;}
41 void markClean() {mDirty = false;}
daniel@transgaming.com4ba24062012-12-20 20:54:24 +000042 virtual bool isDirty() const = 0;
daniel@transgaming.comb9d7e6f2012-10-31 19:08:32 +000043
Geoff Lang005df412013-10-16 14:12:50 -040044 virtual bool redefine(Renderer *renderer, GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, bool forceRelease) = 0;
daniel@transgaming.comb9d7e6f2012-10-31 19:08:32 +000045
shannon.woods%transgaming.com@gtempaccount.com4760c562013-04-13 03:42:30 +000046 virtual void loadData(GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth,
shannonwoods@chromium.org557aab02013-05-30 00:08:27 +000047 GLint unpackAlignment, GLenum type, const void *input) = 0;
shannon.woods%transgaming.com@gtempaccount.com4760c562013-04-13 03:42:30 +000048 virtual void loadCompressedData(GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth,
daniel@transgaming.com4ba24062012-12-20 20:54:24 +000049 const void *input) = 0;
daniel@transgaming.comb9d7e6f2012-10-31 19:08:32 +000050
shannon.woods%transgaming.com@gtempaccount.come5dcce72013-04-13 03:44:33 +000051 virtual void copy(GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height, gl::Framebuffer *source) = 0;
daniel@transgaming.comb9d7e6f2012-10-31 19:08:32 +000052
daniel@transgaming.com4ba24062012-12-20 20:54:24 +000053 protected:
daniel@transgaming.comb9d7e6f2012-10-31 19:08:32 +000054 GLsizei mWidth;
55 GLsizei mHeight;
shannon.woods%transgaming.com@gtempaccount.com4760c562013-04-13 03:42:30 +000056 GLsizei mDepth;
Geoff Lang005df412013-10-16 14:12:50 -040057 GLenum mInternalFormat;
daniel@transgaming.com4ba24062012-12-20 20:54:24 +000058 GLenum mActualFormat;
shannonwoods@chromium.org803be0a2013-05-30 00:08:59 +000059 bool mRenderable;
shannon.woods%transgaming.com@gtempaccount.com56074f32013-04-13 03:45:30 +000060 GLenum mTarget;
daniel@transgaming.comb9d7e6f2012-10-31 19:08:32 +000061
62 bool mDirty;
63
daniel@transgaming.com4ba24062012-12-20 20:54:24 +000064 private:
65 DISALLOW_COPY_AND_ASSIGN(Image);
daniel@transgaming.comb9d7e6f2012-10-31 19:08:32 +000066};
daniel@transgaming.com4ba24062012-12-20 20:54:24 +000067
daniel@transgaming.comb9d7e6f2012-10-31 19:08:32 +000068}
69
daniel@transgaming.com4ba24062012-12-20 20:54:24 +000070#endif // LIBGLESV2_RENDERER_IMAGE_H_