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

Side by Side Diff: chrome/browser/ui/libgtkui/skia_utils_gtk.cc

Issue 2707313002: Gtk: Change NULL to nullptr (Closed)
Patch Set: Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/libgtkui/skia_utils_gtk.h" 5 #include "chrome/browser/ui/libgtkui/skia_utils_gtk.h"
6 6
7 #include <gdk/gdk.h> 7 #include <gdk/gdk.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "third_party/skia/include/core/SkBitmap.h" 10 #include "third_party/skia/include/core/SkBitmap.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 } 79 }
80 } else { 80 } else {
81 NOTREACHED(); 81 NOTREACHED();
82 } 82 }
83 83
84 return ret; 84 return ret;
85 } 85 }
86 86
87 GdkPixbuf* GdkPixbufFromSkBitmap(const SkBitmap& bitmap) { 87 GdkPixbuf* GdkPixbufFromSkBitmap(const SkBitmap& bitmap) {
88 if (bitmap.isNull()) 88 if (bitmap.isNull())
89 return NULL; 89 return nullptr;
90 90
91 SkAutoLockPixels lock_pixels(bitmap); 91 SkAutoLockPixels lock_pixels(bitmap);
92 92
93 int width = bitmap.width(); 93 int width = bitmap.width();
94 int height = bitmap.height(); 94 int height = bitmap.height();
95 95
96 GdkPixbuf* pixbuf = 96 GdkPixbuf* pixbuf =
97 gdk_pixbuf_new(GDK_COLORSPACE_RGB, // The only colorspace gtk supports. 97 gdk_pixbuf_new(GDK_COLORSPACE_RGB, // The only colorspace gtk supports.
98 TRUE, // There is an alpha channel. 98 TRUE, // There is an alpha channel.
99 8, width, height); 99 8, width, height);
(...skipping 20 matching lines...) Expand all
120 divided[i + 3] = alpha; 120 divided[i + 3] = alpha;
121 } 121 }
122 i += kBytesPerPixel; 122 i += kBytesPerPixel;
123 } 123 }
124 } 124 }
125 125
126 return pixbuf; 126 return pixbuf;
127 } 127 }
128 128
129 } // namespace libgtkui 129 } // namespace libgtkui
OLDNEW
« no previous file with comments | « chrome/browser/ui/libgtkui/select_file_dialog_impl_gtk.cc ('k') | chrome/browser/ui/libgtkui/unity_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698