summaryrefslogtreecommitdiffstats
path: root/libs/surfaceflinger/LayerDim.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-05-11 00:03:41 -0700
committerMathias Agopian <mathias@google.com>2009-05-17 23:34:16 -0700
commit6158b1bf0364da1582468a98ec09d004ba99deec (patch)
tree6fc11335f772f84dbee308e830d807fe0df1f815 /libs/surfaceflinger/LayerDim.cpp
parent11be99de5f3901c32130ea4c5fd52e62e1845e73 (diff)
downloadframeworks_base-6158b1bf0364da1582468a98ec09d004ba99deec.zip
frameworks_base-6158b1bf0364da1582468a98ec09d004ba99deec.tar.gz
frameworks_base-6158b1bf0364da1582468a98ec09d004ba99deec.tar.bz2
Region now has its own implementation instead of relying on SkRegion, which allows us to break libui's dependency on libcorecg.
Diffstat (limited to 'libs/surfaceflinger/LayerDim.cpp')
-rw-r--r--libs/surfaceflinger/LayerDim.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/libs/surfaceflinger/LayerDim.cpp b/libs/surfaceflinger/LayerDim.cpp
index f2519c4..c1e8ad6 100644
--- a/libs/surfaceflinger/LayerDim.cpp
+++ b/libs/surfaceflinger/LayerDim.cpp
@@ -52,8 +52,9 @@ void LayerDim::onDraw(const Region& clip) const
// FIXME: on some h/w (like msm7K, it will be faster to use a texture)
const State& s(drawingState());
- Region::iterator iterator(clip);
- if (s.alpha>0 && iterator) {
+ Region::const_iterator it = clip.begin();
+ Region::const_iterator const end = clip.end();
+ if (s.alpha>0 && (it != end)) {
const DisplayHardware& hw(graphicPlane(0).displayHardware());
const GGLfixed alpha = (s.alpha << 16)/255;
const uint32_t fbHeight = hw.getHeight();
@@ -63,8 +64,8 @@ void LayerDim::onDraw(const Region& clip) const
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
glColor4x(0, 0, 0, alpha);
glVertexPointer(2, GL_FIXED, 0, mVertices);
- Rect r;
- while (iterator.iterate(&r)) {
+ while (it != end) {
+ const Rect& r = *it++;
const GLint sy = fbHeight - (r.top + r.height());
glScissor(r.left, sy, r.width(), r.height());
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);