From 0556d90253902ae797e4fcea79602a30ff16f82c Mon Sep 17 00:00:00 2001 From: Chris Craik Date: Tue, 3 Mar 2015 09:54:14 -0800 Subject: Glop DrawPatch support Change-Id: Icaa78bdb2cf52c1fc2194ec4016634967d17fb6a --- libs/hwui/GlopBuilder.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'libs/hwui/GlopBuilder.cpp') diff --git a/libs/hwui/GlopBuilder.cpp b/libs/hwui/GlopBuilder.cpp index 07d99ab4282c..f94dc38debab 100644 --- a/libs/hwui/GlopBuilder.cpp +++ b/libs/hwui/GlopBuilder.cpp @@ -18,6 +18,7 @@ #include "Caches.h" #include "Glop.h" #include "Matrix.h" +#include "Patch.h" #include "renderstate/MeshState.h" #include "renderstate/RenderState.h" #include "SkiaShader.h" @@ -189,6 +190,20 @@ GlopBuilder& GlopBuilder::setMeshVertexBuffer(const VertexBuffer& vertexBuffer, return *this; } +GlopBuilder& GlopBuilder::setMeshPatchQuads(const Patch& patch) { + TRIGGER_STAGE(kMeshStage); + + mOutGlop->mesh.primitiveMode = GL_TRIANGLES; + mOutGlop->mesh.indices = { mRenderState.meshState().getQuadListIBO(), nullptr }; + mOutGlop->mesh.vertices = { + mCaches.patchCache.getMeshBuffer(), + VertexAttribFlags::kTextureCoord, + (void*)patch.offset, (void*)patch.textureOffset, nullptr, + kTextureVertexStride }; + mOutGlop->mesh.elementCount = patch.indexCount; + return *this; +} + //////////////////////////////////////////////////////////////////////////////// // Fill //////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3-59-g8ed1b