diff options
| author | 2011-11-30 20:21:23 -0800 | |
|---|---|---|
| committer | 2011-11-30 20:21:23 -0800 | |
| commit | d21b6e1fe337b35f62cf2028e9bd0637fd009a75 (patch) | |
| tree | 8831d34e2dd0335c158c2aa12bee68452745c8c5 /libs/hwui/Texture.h | |
| parent | 28147b654bba8ae2b7976e58aa7869255e436b0b (diff) | |
Optimize away unnecessary state changes
Change-Id: I0f6816f9f6234853575ecee5033186ad19e76380
Diffstat (limited to 'libs/hwui/Texture.h')
| -rw-r--r-- | libs/hwui/Texture.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/libs/hwui/Texture.h b/libs/hwui/Texture.h index 48229b6e4adb..a4aed0706b48 100644 --- a/libs/hwui/Texture.h +++ b/libs/hwui/Texture.h @@ -40,7 +40,12 @@ struct Texture { firstWrap = true; } - void setWrap(GLenum wrapS, GLenum wrapT, bool bindTexture = false, bool force = false, + void setWrap(GLenum wrap, bool bindTexture = false, bool force = false, + GLenum renderTarget = GL_TEXTURE_2D) { + setWrapST(wrap, wrap, bindTexture, force, renderTarget); + } + + void setWrapST(GLenum wrapS, GLenum wrapT, bool bindTexture = false, bool force = false, GLenum renderTarget = GL_TEXTURE_2D) { if (firstWrap || force || wrapS != this->wrapS || wrapT != this->wrapT) { @@ -58,7 +63,12 @@ struct Texture { } } - void setFilter(GLenum min, GLenum mag, bool bindTexture = false, bool force = false, + void setFilter(GLenum filter, bool bindTexture = false, bool force = false, + GLenum renderTarget = GL_TEXTURE_2D) { + setFilterMinMag(filter, filter, bindTexture, force, renderTarget); + } + + void setFilterMinMag(GLenum min, GLenum mag, bool bindTexture = false, bool force = false, GLenum renderTarget = GL_TEXTURE_2D) { if (firstFilter || force || min != minFilter || mag != magFilter) { |