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

Unified Diff: ui/gfx/gtk_util.cc

Issue 10377122: Convert GdkPixbufFromSkBitmap and GdkPixbufToSkBitmap (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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
« no previous file with comments | « ui/gfx/gtk_util.h ('k') | ui/gfx/image/image.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/gtk_util.cc
diff --git a/ui/gfx/gtk_util.cc b/ui/gfx/gtk_util.cc
index 68a983a5f43a7c611554fdab704669f09a8b2705..f2931111917594008a26d148025b5920e8e44de6 100644
--- a/ui/gfx/gtk_util.cc
+++ b/ui/gfx/gtk_util.cc
@@ -87,15 +87,15 @@ void GdkInitFromCommandLine(const CommandLine& command_line) {
CommonInitFromCommandLine(command_line, gdk_init);
}
-GdkPixbuf* GdkPixbufFromSkBitmap(const SkBitmap* bitmap) {
- if (bitmap->isNull())
+GdkPixbuf* GdkPixbufFromSkBitmap(const SkBitmap& bitmap) {
+ if (bitmap.isNull())
return NULL;
- SkAutoLockPixels lock_pixels(*bitmap);
+ SkAutoLockPixels lock_pixels(bitmap);
- int width = bitmap->width();
- int height = bitmap->height();
- int stride = bitmap->rowBytes();
+ int width = bitmap.width();
+ int height = bitmap.height();
+ int stride = bitmap.rowBytes();
// SkBitmaps are premultiplied, we need to unpremultiply them.
const int kBytesPerPixel = 4;
@@ -103,7 +103,7 @@ GdkPixbuf* GdkPixbufFromSkBitmap(const SkBitmap* bitmap) {
for (int y = 0, i = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
- uint32 pixel = bitmap->getAddr32(0, y)[x];
+ uint32 pixel = bitmap.getAddr32(0, y)[x];
int alpha = SkColorGetA(pixel);
if (alpha != 0 && alpha != 255) {
« no previous file with comments | « ui/gfx/gtk_util.h ('k') | ui/gfx/image/image.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698