diff options
author | Mathias Agopian <mathias@google.com> | 2009-05-11 00:03:41 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2009-05-17 23:34:16 -0700 |
commit | 20f68782a4ea71c6a977d7f87d8288d3daa265ec (patch) | |
tree | 5f286e70c9d2b870d3594354e321795496ef9b4e /libs/surfaceflinger/LayerBlur.cpp | |
parent | d8fb7b586f3cfac42694208547b58438d7f3b3ed (diff) | |
download | frameworks_native-20f68782a4ea71c6a977d7f87d8288d3daa265ec.zip frameworks_native-20f68782a4ea71c6a977d7f87d8288d3daa265ec.tar.gz frameworks_native-20f68782a4ea71c6a977d7f87d8288d3daa265ec.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/LayerBlur.cpp')
-rw-r--r-- | libs/surfaceflinger/LayerBlur.cpp | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/libs/surfaceflinger/LayerBlur.cpp b/libs/surfaceflinger/LayerBlur.cpp index cac3cf1..3d22e3a 100644 --- a/libs/surfaceflinger/LayerBlur.cpp +++ b/libs/surfaceflinger/LayerBlur.cpp @@ -136,8 +136,9 @@ void LayerBlur::onDraw(const Region& clip) const glGenTextures(1, &mTextureName); } - Region::iterator iterator(clip); - if (iterator) { + Region::const_iterator it = clip.begin(); + Region::const_iterator const end = clip.end(); + if (it != end) { glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, mTextureName); @@ -198,27 +199,25 @@ void LayerBlur::onDraw(const Region& clip) const glEnableClientState(GL_TEXTURE_COORD_ARRAY); glVertexPointer(2, GL_FIXED, 0, mVertices); glTexCoordPointer(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); } } else { - Region::iterator iterator(clip); - if (iterator) { - // NOTE: this is marginally faster with the software gl, because - // glReadPixels() reads the fb bottom-to-top, however we'll - // skip all the jaccobian computations. - Rect r; - GLint crop[4] = { 0, 0, w, h }; - glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, crop); - y = fbHeight - (y + h); - while (iterator.iterate(&r)) { - const GLint sy = fbHeight - (r.top + r.height()); - glScissor(r.left, sy, r.width(), r.height()); - glDrawTexiOES(x, y, 0, w, h); - } + // NOTE: this is marginally faster with the software gl, because + // glReadPixels() reads the fb bottom-to-top, however we'll + // skip all the jaccobian computations. + Rect r; + GLint crop[4] = { 0, 0, w, h }; + glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, crop); + y = fbHeight - (y + h); + while (it != end) { + const Rect& r = *it++; + const GLint sy = fbHeight - (r.top + r.height()); + glScissor(r.left, sy, r.width(), r.height()); + glDrawTexiOES(x, y, 0, w, h); } } } |