summaryrefslogtreecommitdiff
path: root/libs/hwui/renderstate/RenderState.cpp
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2015-02-26 16:28:17 -0800
committerChris Craik <ccraik@google.com>2015-02-27 10:50:12 -0800
commit26bf34200e40a0fa8c66366559aa016380cd8c6f (patch)
tree40603e6acbcd9f1d3a3b6f0c0a84314e70ca6f94 /libs/hwui/renderstate/RenderState.cpp
parentb11be294b1e721c08f3756626edfedea35711eb2 (diff)
Glop TextureLayer support
Change-Id: I348a926bd4a2f47be9fdbe74058c0aa2f8dc6276
Diffstat (limited to 'libs/hwui/renderstate/RenderState.cpp')
-rw-r--r--libs/hwui/renderstate/RenderState.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/libs/hwui/renderstate/RenderState.cpp b/libs/hwui/renderstate/RenderState.cpp
index 7992077e0588..ca3a4c2f2f30 100644
--- a/libs/hwui/renderstate/RenderState.cpp
+++ b/libs/hwui/renderstate/RenderState.cpp
@@ -260,19 +260,25 @@ void RenderState::render(const Glop& glop) {
meshState().bindIndicesBufferInternal(indices.bufferObject);
if (vertices.flags & VertexAttribFlags::kTextureCoord) {
- // fill.texture always takes slot 0, shader samplers increment from there
+ const Glop::Fill::TextureData& texture = fill.texture;
+ // texture always takes slot 0, shader samplers increment from there
mCaches->textureState().activateTexture(0);
- if (fill.texture.clamp != GL_INVALID_ENUM) {
- fill.texture.texture->setWrap(fill.texture.clamp, true);
+ if (texture.clamp != GL_INVALID_ENUM) {
+ texture.texture->setWrap(texture.clamp, true);
}
- if (fill.texture.filter != GL_INVALID_ENUM) {
- fill.texture.texture->setFilter(fill.texture.filter, true);
+ if (texture.filter != GL_INVALID_ENUM) {
+ texture.texture->setFilter(texture.filter, true);
}
- mCaches->textureState().bindTexture(fill.texture.texture->id);
+ mCaches->textureState().bindTexture(texture.target, texture.texture->id);
meshState().enableTexCoordsVertexArray();
meshState().bindTexCoordsVertexPointer(force, vertices.texCoord, vertices.stride);
+
+ if (texture.textureTransform) {
+ glUniformMatrix4fv(fill.program->getUniform("mainTextureTransform"), 1,
+ GL_FALSE, &texture.textureTransform->data[0]);
+ }
} else {
meshState().disableTexCoordsVertexArray();
}