mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-11 05:38:31 +09:00
[Refactor] (TextureState.*): Optimize code.
This commit is contained in:
@@ -55,15 +55,15 @@ public:
|
||||
|
||||
class TextureState {
|
||||
private:
|
||||
std::vector<TextureUnitState> textureUnits;
|
||||
GLuint activeTextureUnit = 0;
|
||||
std::vector<TextureUnitState> textureUnits_;
|
||||
GLuint activeTextureUnit_ = 0;
|
||||
|
||||
GLuint lastUsedID = 0;
|
||||
std::set<GLuint> freeIDs;
|
||||
GLuint lastUsedID_ = 0;
|
||||
std::set<GLuint> freeIDs_;
|
||||
|
||||
std::unordered_map<GLenum, TextureObject> proxyTextures;
|
||||
std::unordered_map<GLenum, TextureObject> proxyTextures_;
|
||||
|
||||
static GLint GetUnpackParam(GLenum pname);
|
||||
static GLint GetUnpackParam_(GLenum pname);
|
||||
public:
|
||||
TextureState();
|
||||
|
||||
@@ -89,22 +89,22 @@ public:
|
||||
GLenum GetLevelPropertyIntVector(GLenum target, GLint level, GLenum pname, GLint* params);
|
||||
|
||||
private:
|
||||
size_t CalculatePixelDataSize(GLenum format, GLenum type, GLsizei width, GLsizei height);
|
||||
void InvalidateTextureInAllUnits(GLuint texture);
|
||||
static ComponentSizes GetComponentSizes(GLenum internalFormat);
|
||||
size_t CalculateBytesPerPixel(GLenum format, GLenum type);
|
||||
static size_t GetComponentSize(GLenum type);
|
||||
void SwapBytesForTexture(GLenum format, GLenum type, const GLubyte* src, GLubyte* dst, GLsizei width);
|
||||
static void ReverseBitOrder(const GLubyte* src, GLubyte* dst, size_t size);
|
||||
static GLubyte ReverseBits(GLubyte b);
|
||||
void SwapPixelBytes(GLenum format, GLenum type, const GLubyte* src, GLubyte* dst);
|
||||
size_t CalculatePixelDataSize_(GLenum format, GLenum type, GLsizei width, GLsizei height);
|
||||
void InvalidateTextureInAllUnits_(GLuint texture);
|
||||
static ComponentSizes GetComponentSize_s_(GLenum internalFormat);
|
||||
size_t CalculateBytesPerPixel_(GLenum format, GLenum type);
|
||||
static size_t GetComponentSize_(GLenum type);
|
||||
void SwapBytesForTexture_(GLenum format, GLenum type, const GLubyte* src, GLubyte* dst, GLsizei width);
|
||||
static void ReverseBitOrder_(const GLubyte* src, GLubyte* dst, size_t size);
|
||||
static GLubyte ReverseBits_(GLubyte b);
|
||||
void SwapPixelBytes_(GLenum format, GLenum type, const GLubyte* src, GLubyte* dst);
|
||||
|
||||
GLenum CheckUploadingTexture2DValidity(GLenum target, GLint level, GLint internalFormat,
|
||||
GLenum CheckUploadingTexture2DValidity_(GLenum target, GLint level, GLint internalFormat,
|
||||
GLsizei width, GLsizei height, GLint border, GLenum format,
|
||||
GLenum type, const void* data);
|
||||
GLenum CheckUpdatingTextureRegion2DValidity(GLenum target, GLint level, GLint xoffset,
|
||||
GLint yoffset, GLsizei width, GLsizei height, GLenum format,
|
||||
GLenum type, const GLvoid* data);
|
||||
GLenum CheckUpdatingTextureRegion2DValidity_(GLenum target, GLint level, GLint xoffset,
|
||||
GLint yoffset, GLsizei width, GLsizei height, GLenum format,
|
||||
GLenum type, const GLvoid* data);
|
||||
};
|
||||
|
||||
#endif //MOBILEGL_TEXTURESTATE_H
|
||||
|
||||
Reference in New Issue
Block a user