diff options
author | Chia-I Wu <olvaffe@gmail.com> | 2009-10-30 17:26:51 +0800 |
---|---|---|
committer | Chia-I Wu <olvaffe@gmail.com> | 2009-10-30 17:27:14 +0800 |
commit | ce5af556aa72fc850e5f8657cae186a470b91fb8 (patch) | |
tree | ef66cdbd7e176865dabaed804ad5e1a54611802a /src | |
parent | f457f7a31c03f218cdcb31108fefb343d6be14a8 (diff) |
egl_android: Update native buffer only when it is really changed.
Diffstat (limited to 'src')
-rw-r--r-- | src/egl/drivers/android/droid_intel.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/egl/drivers/android/droid_intel.c b/src/egl/drivers/android/droid_intel.c index 3209ff9af7..0955aaa67e 100644 --- a/src/egl/drivers/android/droid_intel.c +++ b/src/egl/drivers/android/droid_intel.c @@ -394,6 +394,7 @@ static void update_native_buffer(struct droid_surface *surf) { struct droid_surface_intel *isurf = lookup_surface(surf); + __DRIbuffer *buf = &isurf->native_buffer; unsigned int name, cpp, pitch, width, height; switch (isurf->type) { @@ -417,16 +418,19 @@ update_native_buffer(struct droid_surface *surf) break; } - isurf->native_buffer.attachment = __DRI_BUFFER_FRONT_LEFT; - isurf->native_buffer.name = name; - isurf->native_buffer.cpp = cpp; - isurf->native_buffer.pitch = pitch; - isurf->native_buffer.flags = 0; + if (buf->name != name || buf->cpp != cpp || buf->pitch != pitch || + isurf->native_width != width || isurf->native_height != height) { + buf->attachment = __DRI_BUFFER_FRONT_LEFT; + buf->name = name; + buf->cpp = cpp; + buf->pitch = pitch; + buf->flags = 0; - isurf->native_width = width; - isurf->native_height = height; + isurf->native_width = width; + isurf->native_height = height; - isurf->native_changed = 1; + isurf->native_changed = 1; + } } static struct droid_surface * |