summaryrefslogtreecommitdiffstats
path: root/opengl/libagl
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-11-09 19:38:43 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2009-11-09 19:38:43 -0800
commitc6ed8100c2385596117a033e999519e31c5c1c0e (patch)
tree5fdf2736dac050bc2ebd2a243b5276c5c2b6762b /opengl/libagl
parenteac4222f7f30bf1df14b223cf62e594914dd32d4 (diff)
parent0b9d3ba2feab494e7bbd180b51a4311864d08e13 (diff)
downloadframeworks_base-c6ed8100c2385596117a033e999519e31c5c1c0e.zip
frameworks_base-c6ed8100c2385596117a033e999519e31c5c1c0e.tar.gz
frameworks_base-c6ed8100c2385596117a033e999519e31c5c1c0e.tar.bz2
am 0b9d3ba2: am c421fc2a: Merge change Id09376d1 into eclair
Merge commit '0b9d3ba2feab494e7bbd180b51a4311864d08e13' into eclair-mr2-plus-aosp * commit '0b9d3ba2feab494e7bbd180b51a4311864d08e13': fix [2071412] work around mdp 32-bits fade limitation
Diffstat (limited to 'opengl/libagl')
-rw-r--r--opengl/libagl/copybit.cpp27
1 files changed, 23 insertions, 4 deletions
diff --git a/opengl/libagl/copybit.cpp b/opengl/libagl/copybit.cpp
index 1bef859..a68750e 100644
--- a/opengl/libagl/copybit.cpp
+++ b/opengl/libagl/copybit.cpp
@@ -388,14 +388,33 @@ static bool copybit(GLint x, GLint y,
copybit_image_t tmpCbImg;
copybit_rect_t tmpCbRect;
+ copybit_rect_t tmpdrect = drect;
tmpCbImg.w = w;
tmpCbImg.h = h;
tmpCbImg.format = tempCb->format;
tmpCbImg.handle = (native_handle_t*)tempCb->getNativeBuffer()->handle;
tmpCbRect.l = 0;
tmpCbRect.t = 0;
- tmpCbRect.r = w;
- tmpCbRect.b = h;
+
+ if (drect.l < 0) {
+ tmpCbRect.l = -tmpdrect.l;
+ tmpdrect.l = 0;
+ }
+ if (drect.t < 0) {
+ tmpCbRect.t = -tmpdrect.t;
+ tmpdrect.t = 0;
+ }
+ if (drect.l + tmpCbImg.w > dst.w) {
+ tmpCbImg.w = dst.w - drect.l;
+ tmpdrect.r = dst.w;
+ }
+ if (drect.t + tmpCbImg.h > dst.h) {
+ tmpCbImg.h = dst.h - drect.t;
+ tmpdrect.b = dst.h;
+ }
+
+ tmpCbRect.r = tmpCbImg.w;
+ tmpCbRect.b = tmpCbImg.h;
if (!err) {
// first make a copy of the destination buffer
@@ -404,7 +423,7 @@ static bool copybit(GLint x, GLint y,
copybit->set_parameter(copybit, COPYBIT_PLANE_ALPHA, 0xFF);
copybit->set_parameter(copybit, COPYBIT_DITHER, COPYBIT_DISABLE);
err = copybit->stretch(copybit,
- &tmpCbImg, &dst, &tmpCbRect, &drect, &tmp_it);
+ &tmpCbImg, &dst, &tmpCbRect, &tmpdrect, &tmp_it);
}
if (!err) {
// then proceed as usual, but without the alpha plane
@@ -424,7 +443,7 @@ static bool copybit(GLint x, GLint y,
copybit->set_parameter(copybit, COPYBIT_PLANE_ALPHA, invPlaneAlpha);
copybit->set_parameter(copybit, COPYBIT_DITHER, COPYBIT_ENABLE);
err = copybit->stretch(copybit,
- &dst, &tmpCbImg, &drect, &tmpCbRect, &it);
+ &dst, &tmpCbImg, &tmpdrect, &tmpCbRect, &it);
}
} else {
copybit->set_parameter(copybit, COPYBIT_TRANSFORM, transform);