1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/angle/src/libGLESv2/renderer/Image9.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,79 @@ 1.4 +// 1.5 +// Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved. 1.6 +// Use of this source code is governed by a BSD-style license that can be 1.7 +// found in the LICENSE file. 1.8 +// 1.9 + 1.10 +// Image9.h: Defines the rx::Image9 class, which acts as the interface to 1.11 +// the actual underlying surfaces of a Texture. 1.12 + 1.13 +#ifndef LIBGLESV2_RENDERER_IMAGE9_H_ 1.14 +#define LIBGLESV2_RENDERER_IMAGE9_H_ 1.15 + 1.16 +#include "libGLESv2/renderer/Image.h" 1.17 +#include "common/debug.h" 1.18 + 1.19 +namespace gl 1.20 +{ 1.21 +class Framebuffer; 1.22 +} 1.23 + 1.24 +namespace rx 1.25 +{ 1.26 +class Renderer; 1.27 +class Renderer9; 1.28 +class TextureStorageInterface2D; 1.29 +class TextureStorageInterfaceCube; 1.30 + 1.31 +class Image9 : public Image 1.32 +{ 1.33 + public: 1.34 + Image9(); 1.35 + ~Image9(); 1.36 + 1.37 + static Image9 *makeImage9(Image *img); 1.38 + 1.39 + static void generateMipmap(Image9 *dest, Image9 *source); 1.40 + static void generateMip(IDirect3DSurface9 *destSurface, IDirect3DSurface9 *sourceSurface); 1.41 + static void copyLockableSurfaces(IDirect3DSurface9 *dest, IDirect3DSurface9 *source); 1.42 + 1.43 + virtual bool redefine(Renderer *renderer, GLint internalformat, GLsizei width, GLsizei height, bool forceRelease); 1.44 + 1.45 + virtual bool isRenderableFormat() const; 1.46 + D3DFORMAT getD3DFormat() const; 1.47 + 1.48 + virtual bool isDirty() const {return mSurface && mDirty;} 1.49 + IDirect3DSurface9 *getSurface(); 1.50 + 1.51 + virtual void setManagedSurface(TextureStorageInterface2D *storage, int level); 1.52 + virtual void setManagedSurface(TextureStorageInterfaceCube *storage, int face, int level); 1.53 + virtual bool updateSurface(TextureStorageInterface2D *storage, int level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height); 1.54 + virtual bool updateSurface(TextureStorageInterfaceCube *storage, int face, int level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height); 1.55 + 1.56 + virtual void loadData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, 1.57 + GLint unpackAlignment, const void *input); 1.58 + virtual void loadCompressedData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, 1.59 + const void *input); 1.60 + 1.61 + virtual void copy(GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, gl::Framebuffer *source); 1.62 + 1.63 + private: 1.64 + DISALLOW_COPY_AND_ASSIGN(Image9); 1.65 + 1.66 + void createSurface(); 1.67 + void setManagedSurface(IDirect3DSurface9 *surface); 1.68 + bool updateSurface(IDirect3DSurface9 *dest, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height); 1.69 + 1.70 + HRESULT lock(D3DLOCKED_RECT *lockedRect, const RECT *rect); 1.71 + void unlock(); 1.72 + 1.73 + Renderer9 *mRenderer; 1.74 + 1.75 + D3DPOOL mD3DPool; // can only be D3DPOOL_SYSTEMMEM or D3DPOOL_MANAGED since it needs to be lockable. 1.76 + D3DFORMAT mD3DFormat; 1.77 + 1.78 + IDirect3DSurface9 *mSurface; 1.79 +}; 1.80 +} 1.81 + 1.82 +#endif // LIBGLESV2_RENDERER_IMAGE9_H_