summaryrefslogtreecommitdiffstats
path: root/opengl/libagl
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-06-18 19:31:07 -0700
committerMathias Agopian <mathias@google.com>2009-06-18 19:31:07 -0700
commit09cf0ac2e9ec9e18c7099312265f9d51cdbb0f37 (patch)
tree0acf290cf67fec626d9a8fea347aa72a536fb7a8 /opengl/libagl
parent9cc88529e4cbf54df3eed968666472d3fa658d13 (diff)
downloadframeworks_base-09cf0ac2e9ec9e18c7099312265f9d51cdbb0f37.zip
frameworks_base-09cf0ac2e9ec9e18c7099312265f9d51cdbb0f37.tar.gz
frameworks_base-09cf0ac2e9ec9e18c7099312265f9d51cdbb0f37.tar.bz2
we were not fetching the texture coords in the copybit case, so we were using garbage
Diffstat (limited to 'opengl/libagl')
-rw-r--r--opengl/libagl/copybit.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/opengl/libagl/copybit.cpp b/opengl/libagl/copybit.cpp
index a663f75..cde8f8a 100644
--- a/opengl/libagl/copybit.cpp
+++ b/opengl/libagl/copybit.cpp
@@ -293,6 +293,7 @@ bool drawTriangleFanWithCopybit_impl(ogles_context_t* c, GLint first, GLsizei co
return false;
}
+ // FIXME: we should handle culling here
c->arrays.compileElements(c, c->vc.vBuffer, 0, 4);
// we detect if we're dealing with a rectangle, by comparing the
@@ -316,6 +317,18 @@ bool drawTriangleFanWithCopybit_impl(ogles_context_t* c, GLint first, GLsizei co
LOGD_IF(DEBUG_COPYBIT, "geometry not a rectangle");
return false;
}
+
+ // fetch and transform texture coordinates
+ // NOTE: maybe it would be better to have a "compileElementsAll" method
+ // that would ensure all vertex data are fetched and transformed
+ const transform_t& tr = c->transforms.texture[0].transform;
+ for (size_t i=0 ; i<4 ; i++) {
+ const GLubyte* tp = c->arrays.texture[0].element(i);
+ vertex_t* const v = &c->vc.vBuffer[i];
+ c->arrays.texture[0].fetch(c, v->texture[0].v, tp);
+ // FIXME: we should bail if q!=1
+ c->arrays.tex_transform[0](&tr, &v->texture[0], &v->texture[0]);
+ }
const vec4_t& t0 = c->vc.vBuffer[0].texture[0];
const vec4_t& t1 = c->vc.vBuffer[1].texture[0];
@@ -333,7 +346,8 @@ bool drawTriangleFanWithCopybit_impl(ogles_context_t* c, GLint first, GLsizei co
if ((txl != 0) || (txb != 0) ||
(txr != FIXED_ONE) || (txt != FIXED_ONE)) {
// we could probably handle this case, if we wanted to
- LOGD_IF(DEBUG_COPYBIT, "texture is cropped");
+ LOGD_IF(DEBUG_COPYBIT, "texture is cropped: %08x,%08x,%08x,%08x",
+ txl, txb, txr, txt);
return false;
}