diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2016-05-04 01:03:40 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2016-05-04 01:03:42 +0000 |
commit | b2e36d7939610de538a6ec95a821b61b365b3073 (patch) | |
tree | 353f2081b27993d54e7a7dd8f682ae9eec11e474 /libs/hwui/renderstate/RenderState.cpp | |
parent | 976b9b04e4b38c3be2f91d6955e53874ad52cb10 (diff) | |
parent | 138c21fbec12bead3c7ca1f181c3fd35542ccb00 (diff) |
Merge "Use LUT for computing final shadow alpha" into nyc-dev
Diffstat (limited to 'libs/hwui/renderstate/RenderState.cpp')
-rw-r--r-- | libs/hwui/renderstate/RenderState.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libs/hwui/renderstate/RenderState.cpp b/libs/hwui/renderstate/RenderState.cpp index ea4391b87006..e78cd7296f42 100644 --- a/libs/hwui/renderstate/RenderState.cpp +++ b/libs/hwui/renderstate/RenderState.cpp @@ -298,7 +298,8 @@ void RenderState::render(const Glop& glop, const Matrix4& orthoMatrix) { // indices meshState().bindIndicesBuffer(indices.bufferObject); - if (vertices.attribFlags & VertexAttribFlags::TextureCoord) { + // texture + if (fill.texture.texture != nullptr) { const Glop::Fill::TextureData& texture = fill.texture; // texture always takes slot 0, shader samplers increment from there mCaches->textureState().activateTexture(0); @@ -311,13 +312,16 @@ void RenderState::render(const Glop& glop, const Matrix4& orthoMatrix) { texture.texture->setFilter(texture.filter, false, false, texture.target); } - meshState().enableTexCoordsVertexArray(); - meshState().bindTexCoordsVertexPointer(vertices.texCoord, vertices.stride); - if (texture.textureTransform) { glUniformMatrix4fv(fill.program->getUniform("mainTextureTransform"), 1, GL_FALSE, &texture.textureTransform->data[0]); } + } + + // vertex attributes (tex coord, color, alpha) + if (vertices.attribFlags & VertexAttribFlags::TextureCoord) { + meshState().enableTexCoordsVertexArray(); + meshState().bindTexCoordsVertexPointer(vertices.texCoord, vertices.stride); } else { meshState().disableTexCoordsVertexArray(); } |