Glop DrawPatch support
Change-Id: Icaa78bdb2cf52c1fc2194ec4016634967d17fb6a
diff --git a/libs/hwui/GlopBuilder.cpp b/libs/hwui/GlopBuilder.cpp
index 07d99ab..f94dc38 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 @@
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
////////////////////////////////////////////////////////////////////////////////