Implement first pass bitmap to allocation support. The Java bindings can create a 2D allocation by passing in a Bitmap object.
diff --git a/libs/rs/rsScriptC.cpp b/libs/rs/rsScriptC.cpp
index 3c4bfa2..60339ec 100644
--- a/libs/rs/rsScriptC.cpp
+++ b/libs/rs/rsScriptC.cpp
@@ -261,6 +261,35 @@
glDrawArrays(GL_TRIANGLES, 0, count * 3);
}
+extern "C" void drawRect(void *vp, int32_t x1, int32_t x2, int32_t y1, int32_t y2)
+{
+ x1 = (x1 << 16);
+ x2 = (x2 << 16);
+ y1 = (y1 << 16);
+ y2 = (y2 << 16);
+
+ int32_t vtx[] = {x1,y1, x1,y2, x2,y1, x2,y2};
+ static const int32_t tex[] = {0,0, 0,0x10000, 0x10000,0, 0x10000,0x10000};
+
+
+ ScriptC::Env * env = static_cast<ScriptC::Env *>(vp);
+ env->mContext->setupCheck();
+
+ glBindBuffer(GL_ARRAY_BUFFER, 0);
+ //glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, tm->mBufferObjects[1]);
+
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+ glDisableClientState(GL_NORMAL_ARRAY);
+ glDisableClientState(GL_COLOR_ARRAY);
+
+ glVertexPointer(2, GL_FIXED, 8, vtx);
+ glTexCoordPointer(2, GL_FIXED, 8, tex);
+ //glColorPointer(4, GL_UNSIGNED_BYTE, 12, ptr);
+
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+}
+
extern "C" void pfBindTexture(void *vp, RsProgramFragment vpf, uint32_t slot, RsAllocation va)
{
//LOGE("pfBindTexture %p", vpf);
@@ -326,8 +355,6 @@
matrixTranslate,
color,
- renderTriangleMesh,
- renderTriangleMeshRange,
pfBindTexture,
pfBindSampler,
@@ -341,9 +368,16 @@
disable,
scriptRand,
- drawTriangleArray,
contextBindProgramFragment,
- contextBindProgramFragmentStore
+ contextBindProgramFragmentStore,
+
+
+ renderTriangleMesh,
+ renderTriangleMeshRange,
+
+ drawTriangleArray,
+ drawRect
+
};