summaryrefslogtreecommitdiff
path: root/libs/hwui/GlopBuilder.cpp
diff options
context:
space:
mode:
author Chris Craik <ccraik@google.com> 2015-03-03 09:54:14 -0800
committer Chris Craik <ccraik@google.com> 2015-03-03 09:54:14 -0800
commit0556d90253902ae797e4fcea79602a30ff16f82c (patch)
treeab516c46f81b1ae35a6803435197704e396f304f /libs/hwui/GlopBuilder.cpp
parenta6b52198b9e73a4b7f80103116feeace74433246 (diff)
Glop DrawPatch support
Change-Id: Icaa78bdb2cf52c1fc2194ec4016634967d17fb6a
Diffstat (limited to 'libs/hwui/GlopBuilder.cpp')
-rw-r--r--libs/hwui/GlopBuilder.cpp15
1 files changed, 15 insertions, 0 deletions
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
////////////////////////////////////////////////////////////////////////////////