diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-04 21:41:00 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-04 21:41:00 +0000 |
commit | 4fb668468ccbf3c79ea359beea537ab183c36086 (patch) | |
tree | 2e1dfc30a295d65e41de52bbedfddaa067b6e842 /skia | |
parent | b967dad2957a86bd0aed778932b63d89c9795a0f (diff) | |
download | chromium_src-4fb668468ccbf3c79ea359beea537ab183c36086.zip chromium_src-4fb668468ccbf3c79ea359beea537ab183c36086.tar.gz chromium_src-4fb668468ccbf3c79ea359beea537ab183c36086.tar.bz2 |
Preserve optimized scrolling in the presence of multiple animating rects.
Change PlatformCanvas so that it only fills with "sea foam green" when bitmap data is not externally supplied. Modifying the interface to make this an option bloated the CL too much. I may do this as a follow-up.
Adds a new --show-paint-rects command line flag that will render a border around paint rects to help debug and study WebKit painting issues.
R=brettw
BUG=25905
TEST=none
Review URL: http://codereview.chromium.org/414016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33861 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia')
-rw-r--r-- | skia/ext/bitmap_platform_device_linux.cc | 15 | ||||
-rw-r--r-- | skia/ext/bitmap_platform_device_linux.h | 5 | ||||
-rw-r--r-- | skia/ext/bitmap_platform_device_mac.cc | 13 | ||||
-rw-r--r-- | skia/ext/bitmap_platform_device_win.cc | 15 |
4 files changed, 27 insertions, 21 deletions
diff --git a/skia/ext/bitmap_platform_device_linux.cc b/skia/ext/bitmap_platform_device_linux.cc index b53b1b3..ccd8d27 100644 --- a/skia/ext/bitmap_platform_device_linux.cc +++ b/skia/ext/bitmap_platform_device_linux.cc @@ -144,12 +144,6 @@ BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height, bitmap.setPixels(cairo_image_surface_get_data(surface)); bitmap.setIsOpaque(is_opaque); -#ifndef NDEBUG - if (is_opaque) { - bitmap.eraseARGB(255, 0, 255, 128); // bright bluish green - } -#endif - // The device object will take ownership of the graphics context. return new BitmapPlatformDevice (bitmap, new BitmapPlatformDeviceData(surface)); @@ -161,7 +155,14 @@ BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height, cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height); - return Create(width, height, is_opaque, surface); + BitmapPlatformDevice* device = Create(width, height, is_opaque, surface); + +#ifndef NDEBUG + if (is_opaque) // Fill with bright bluish green + device->eraseColor(SkColorSetARGB(255, 0, 255, 128)); +#endif + + return device; } BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height, diff --git a/skia/ext/bitmap_platform_device_linux.h b/skia/ext/bitmap_platform_device_linux.h index eb6ffa9..c2bcdb6 100644 --- a/skia/ext/bitmap_platform_device_linux.h +++ b/skia/ext/bitmap_platform_device_linux.h @@ -64,8 +64,6 @@ class BitmapPlatformDevice : public PlatformDevice { // This doesn't take ownership of |data| static BitmapPlatformDevice* Create(int width, int height, bool is_opaque, uint8_t* data); - static BitmapPlatformDevice* Create(int width, int height, - bool is_opaque, cairo_surface_t* surface); // Create a BitmapPlatformDeviceLinux from an already constructed bitmap; // you should probably be using Create(). This may become private later if @@ -92,6 +90,9 @@ class BitmapPlatformDevice : public PlatformDevice { virtual void setMatrixClip(const SkMatrix& transform, const SkRegion& region); private: + static BitmapPlatformDevice* Create(int width, int height, bool is_opaque, + cairo_surface_t* surface); + scoped_refptr<BitmapPlatformDeviceData> data_; }; diff --git a/skia/ext/bitmap_platform_device_mac.cc b/skia/ext/bitmap_platform_device_mac.cc index 0f77406..8a46736 100644 --- a/skia/ext/bitmap_platform_device_mac.cc +++ b/skia/ext/bitmap_platform_device_mac.cc @@ -197,17 +197,18 @@ BitmapPlatformDevice* BitmapPlatformDevice::Create(CGContextRef context, bitmap.setPixels(data); } else { data = bitmap.getPixels(); - } - // Note: The Windows implementation clears the Bitmap later on. - // This bears mentioning since removal of this line makes the - // unit tests only fail periodically (or when MallocPreScribble is set). - bitmap.eraseARGB(0, 0, 0, 0); + // Note: The Windows implementation clears the Bitmap later on. + // This bears mentioning since removal of this line makes the + // unit tests only fail periodically (or when MallocPreScribble is set). + bitmap.eraseARGB(0, 0, 0, 0); + } bitmap.setIsOpaque(is_opaque); + // If we were given data, then don't clobber it! #ifndef NDEBUG - if (is_opaque) { + if (!context && is_opaque) { // To aid in finding bugs, we set the background color to something // obviously wrong so it will be noticable when it is not cleared bitmap.eraseARGB(255, 0, 255, 128); // bright bluish green diff --git a/skia/ext/bitmap_platform_device_win.cc b/skia/ext/bitmap_platform_device_win.cc index edc5d69..27323cb 100644 --- a/skia/ext/bitmap_platform_device_win.cc +++ b/skia/ext/bitmap_platform_device_win.cc @@ -209,14 +209,17 @@ BitmapPlatformDevice* BitmapPlatformDevice::create( bitmap.setPixels(data); bitmap.setIsOpaque(is_opaque); - if (is_opaque) { + // If we were given data, then don't clobber it! + if (!shared_section) { + if (is_opaque) { #ifndef NDEBUG - // To aid in finding bugs, we set the background color to something - // obviously wrong so it will be noticable when it is not cleared - bitmap.eraseARGB(255, 0, 255, 128); // bright bluish green + // To aid in finding bugs, we set the background color to something + // obviously wrong so it will be noticable when it is not cleared + bitmap.eraseARGB(255, 0, 255, 128); // bright bluish green #endif - } else { - bitmap.eraseARGB(0, 0, 0, 0); + } else { + bitmap.eraseARGB(0, 0, 0, 0); + } } // The device object will take ownership of the HBITMAP. The initial refcount |