Bug 811924 - Center boot animation on black background. r=mwu

Change-Id: I110e75331fa5455c226a9b4d23748372ca9ccbe9
---
 widget/gonk/libdisplay/BootAnimation.cpp |   23 +++++++++++++++++++++--
 1 files changed, 21 insertions(+), 2 deletions(-)
This commit is contained in:
Michael Vines 2013-08-06 15:12:27 -07:00
Родитель e3dbebce3e
Коммит 530aef2a1d
1 изменённых файлов: 21 добавлений и 2 удалений

Просмотреть файл

@ -524,8 +524,27 @@ AnimationThread(void *)
display->QueueBuffer(buf);
break;
}
memcpy(vaddr, frame.buf,
frame.width * frame.height * frame.bytepp);
if (buf->height == frame.height && buf->width == frame.width) {
memcpy(vaddr, frame.buf,
frame.width * frame.height * frame.bytepp);
} else if (buf->height >= frame.height &&
buf->width >= frame.width) {
int startx = (buf->width - frame.width) / 2;
int starty = (buf->height - frame.height) / 2;
int src_stride = frame.width * frame.bytepp;
int dst_stride = buf->stride * frame.bytepp;
char *src = frame.buf;
char *dst = (char *) vaddr + starty * dst_stride + startx * frame.bytepp;
for (int i = 0; i < frame.height; i++) {
memcpy(dst, src, src_stride);
src += src_stride;
dst += dst_stride;
}
}
grmodule->unlock(grmodule, buf->handle);
gettimeofday(&tv2, nullptr);