Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Unified Diff: skia/ext/bitmap_platform_device_linux.cc

Issue 9416017: Optionally clear PlatformCanvas instances. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Address style issues. Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: skia/ext/bitmap_platform_device_linux.cc
===================================================================
--- skia/ext/bitmap_platform_device_linux.cc (revision 123041)
+++ skia/ext/bitmap_platform_device_linux.cc (working copy)
@@ -81,13 +81,13 @@
// required so that we can call the base class' constructor with the pixel
// data.
BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height,
- bool is_opaque,
+ int flags,
cairo_surface_t* surface) {
SkBitmap bitmap;
bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height,
cairo_image_surface_get_stride(surface));
bitmap.setPixels(cairo_image_surface_get_data(surface));
- bitmap.setIsOpaque(is_opaque);
+ bitmap.setIsOpaque(flags & FLAGS_OPAQUE);
// The device object will take ownership of the graphics context.
return new BitmapPlatformDevice
@@ -95,15 +95,15 @@
}
BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height,
- bool is_opaque) {
+ int flags) {
// This initializes the bitmap to all zeros.
cairo_surface_t* surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
width, height);
- BitmapPlatformDevice* device = Create(width, height, is_opaque, surface);
+ BitmapPlatformDevice* device = Create(width, height, flags, surface);
#ifndef NDEBUG
- if (is_opaque) // Fill with bright bluish green
+ if (flags & FLAGS_OPAQUE) // Fill with bright bluish green
device->eraseColor(SkColorSetARGB(255, 0, 255, 128));
#endif
@@ -111,13 +111,12 @@
}
BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height,
- bool is_opaque,
- uint8_t* data) {
+ int flags, uint8_t* data) {
cairo_surface_t* surface = cairo_image_surface_create_for_data(
data, CAIRO_FORMAT_ARGB32, width, height,
cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, width));
- return Create(width, height, is_opaque, surface);
+ return Create(width, height, flags, surface);
}
// The device will own the bitmap, which corresponds to also owning the pixel
@@ -137,7 +136,7 @@
SkBitmap::Config config, int width, int height, bool isOpaque,
Usage /*usage*/) {
SkASSERT(config == SkBitmap::kARGB_8888_Config);
- return BitmapPlatformDevice::Create(width, height, isOpaque);
+ return BitmapPlatformDevice::Create(width, height, GetDefaultFlags(isOpaque));
Jeff Timanus 2012/02/23 22:14:10 The various BitmapPlatformDevice::onCreateCompatib
}
cairo_t* BitmapPlatformDevice::BeginPlatformPaint() {

Powered by Google App Engine
This is Rietveld 408576698