summaryrefslogtreecommitdiffstats
path: root/libs/hwui
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2011-12-13 18:39:19 -0800
committerRomain Guy <romainguy@google.com>2011-12-13 18:41:12 -0800
commitec31f83bd3af1f900d1ee9116b15f56904c66dcd (patch)
treeff764a7793f4114db8a0c30c8b16511df2daedf9 /libs/hwui
parenta1d3c91afbd52c7e8b01f4a9060c5459f02ae7a5 (diff)
downloadframeworks_base-ec31f83bd3af1f900d1ee9116b15f56904c66dcd.zip
frameworks_base-ec31f83bd3af1f900d1ee9116b15f56904c66dcd.tar.gz
frameworks_base-ec31f83bd3af1f900d1ee9116b15f56904c66dcd.tar.bz2
<Insert something improper about OpenGL>
Change-Id: Ib645376093838156771588adc76a718da0ceb0db
Diffstat (limited to 'libs/hwui')
-rw-r--r--libs/hwui/Caches.cpp1
-rw-r--r--libs/hwui/Rect.h8
2 files changed, 9 insertions, 0 deletions
diff --git a/libs/hwui/Caches.cpp b/libs/hwui/Caches.cpp
index 96e142c..c3bac5d 100644
--- a/libs/hwui/Caches.cpp
+++ b/libs/hwui/Caches.cpp
@@ -293,6 +293,7 @@ void Caches::resetTexCoordsVertexPointer() {
void Caches::enableTexCoordsVertexArray() {
if (!mTexCoordsArrayEnabled) {
glEnableVertexAttribArray(Program::kBindingTexCoords);
+ mCurrentTexCoordsPointer = this;
mTexCoordsArrayEnabled = true;
}
}
diff --git a/libs/hwui/Rect.h b/libs/hwui/Rect.h
index adf019b..fb76717 100644
--- a/libs/hwui/Rect.h
+++ b/libs/hwui/Rect.h
@@ -124,6 +124,14 @@ public:
return intersect(r.left, r.top, r.right, r.bottom);
}
+ bool contains(float l, float t, float r, float b) {
+ return l >= left && t >= top && r <= right && b <= bottom;
+ }
+
+ bool contains(const Rect& r) {
+ return contains(r.left, r.top, r.right, r.bottom);
+ }
+
bool unionWith(const Rect& r) {
if (r.left < r.right && r.top < r.bottom) {
if (left < right && top < bottom) {