From 0f3e5b69a78388c111fc69c4afc0c8c125e80460 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 25 Jul 2007 18:37:15 +0000 Subject: [PATCH] fix another {get,put}-argb-pixels bug svn: r6963 --- src/wxxt/src/DeviceContexts/WindowDC.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/wxxt/src/DeviceContexts/WindowDC.cc b/src/wxxt/src/DeviceContexts/WindowDC.cc index 66992fed0c..93e6a808e0 100644 --- a/src/wxxt/src/DeviceContexts/WindowDC.cc +++ b/src/wxxt/src/DeviceContexts/WindowDC.cc @@ -3229,6 +3229,21 @@ Bool wxWindowDC::BeginGetPixelFast(int x, int y, int w, int h) if ((x >= 0) && (y >= 0) && ((unsigned int)(x + w) <= X->width) && ((unsigned int)(y + h) <= X->height)) { + + /* Possible improvement: get only the revelant section of the + bitmap into the image cache, instead of always the entire + image. (In that case, use offsets in the fast Get and Put + operations.) */ + + if (X->get_pixel_image_cache + && (X->cache_dx + || X->cache_dy + || (X->get_pixel_image_cache->width < (int)X->width) + || (X->get_pixel_image_cache->height < (int)X->height))) { + /* Need to get out of mini mode */ + EndSetPixel(); + } + BeginSetPixel(0, 0, 0); return TRUE; } else