diff options
author | Chris Craik <ccraik@google.com> | 2015-02-19 09:51:53 -0800 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2015-02-19 18:06:05 -0800 |
commit | f27133df2d179c99d6bc1ae644af09e9153a0071 (patch) | |
tree | af4365366840b8a6c4be4ab337ea3edd22ebba99 /libs/hwui/renderstate | |
parent | a42d2eaf2d6b3cb6072e99b4904b76c8cc263cf3 (diff) | |
download | frameworks_base-f27133df2d179c99d6bc1ae644af09e9153a0071.zip frameworks_base-f27133df2d179c99d6bc1ae644af09e9153a0071.tar.gz frameworks_base-f27133df2d179c99d6bc1ae644af09e9153a0071.tar.bz2 |
Glop layer mesh rendering
Change-Id: I2d902819d5d77f496b67d4d25a298782903e410d
Diffstat (limited to 'libs/hwui/renderstate')
-rw-r--r-- | libs/hwui/renderstate/MeshState.cpp | 1 | ||||
-rw-r--r-- | libs/hwui/renderstate/RenderState.cpp | 22 | ||||
-rw-r--r-- | libs/hwui/renderstate/TextureState.cpp | 2 |
3 files changed, 15 insertions, 10 deletions
diff --git a/libs/hwui/renderstate/MeshState.cpp b/libs/hwui/renderstate/MeshState.cpp index 585fb86..6b00020 100644 --- a/libs/hwui/renderstate/MeshState.cpp +++ b/libs/hwui/renderstate/MeshState.cpp @@ -68,6 +68,7 @@ MeshState::~MeshState() { void MeshState::dump() { ALOGD("MeshState VBOs: unitQuad %d, current %d", mUnitQuadBuffer, mCurrentBuffer); + ALOGD("MeshState IBOs: quadList %d, current %d", mQuadListIndices, mCurrentIndicesBuffer); ALOGD("MeshState vertices: vertex data %p, stride %d", mCurrentPositionPointer, mCurrentPositionStride); ALOGD("MeshState texCoord: data %p, stride %d", diff --git a/libs/hwui/renderstate/RenderState.cpp b/libs/hwui/renderstate/RenderState.cpp index b64dbdc..192bf81 100644 --- a/libs/hwui/renderstate/RenderState.cpp +++ b/libs/hwui/renderstate/RenderState.cpp @@ -253,7 +253,6 @@ void RenderState::render(const Glop& glop) { glUniform1f(fill.program->getUniform("roundRectRadius"), roundedOutRadius); } - // -------------------------------- // ---------- Mesh setup ---------- // -------------------------------- @@ -269,16 +268,16 @@ void RenderState::render(const Glop& glop) { // glop.fill.texture always takes slot 0, shader samplers increment from there mCaches->textureState().activateTexture(0); - if (glop.fill.textureClamp != GL_INVALID_ENUM) { - glop.fill.texture->setWrap(glop.fill.textureClamp, true); + if (glop.fill.texture.clamp != GL_INVALID_ENUM) { + glop.fill.texture.texture->setWrap(glop.fill.texture.clamp, true); } - if (glop.fill.textureFilter != GL_INVALID_ENUM) { - glop.fill.texture->setFilter(glop.fill.textureFilter, true); + if (glop.fill.texture.filter != GL_INVALID_ENUM) { + glop.fill.texture.texture->setFilter(glop.fill.texture.filter, true); } - mCaches->textureState().bindTexture(fill.texture->id); + mCaches->textureState().bindTexture(fill.texture.texture->id); meshState().enableTexCoordsVertexArray(); - meshState().bindTexCoordsVertexPointer(force, mesh.texCoordOffset); + meshState().bindTexCoordsVertexPointer(force, mesh.texCoordOffset, mesh.stride); } else { meshState().disableTexCoordsVertexArray(); } @@ -313,8 +312,13 @@ void RenderState::render(const Glop& glop) { while (elementsCount > 0) { GLsizei drawCount = MathUtils::min(elementsCount, (GLsizei) kMaxNumberOfQuads * 6); - // TODO: this double binds on first pass - meshState().bindPositionVertexPointer(true, vertices, mesh.stride); + // rebind pointers without forcing, since initial bind handled above + meshState().bindPositionVertexPointer(false, vertices, mesh.stride); + if (mesh.vertexFlags & kTextureCoord_Attrib) { + meshState().bindTexCoordsVertexPointer(false, + vertices + kMeshTextureOffset, mesh.stride); + } + glDrawElements(mesh.primitiveMode, drawCount, GL_UNSIGNED_SHORT, nullptr); elementsCount -= drawCount; vertices += (drawCount / 6) * 4 * mesh.stride; diff --git a/libs/hwui/renderstate/TextureState.cpp b/libs/hwui/renderstate/TextureState.cpp index 1a638d2..a211de7 100644 --- a/libs/hwui/renderstate/TextureState.cpp +++ b/libs/hwui/renderstate/TextureState.cpp @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include <renderstate/TextureState.h> +#include "renderstate/TextureState.h" namespace android { namespace uirenderer { |