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

Unified Diff: base/gfx/platform_canvas_linux.cc

Issue 9510: Make PlatformCanvasLinux match up with recent changes in the Windows one, whi... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 1 month 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 | « base/gfx/platform_canvas_linux.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/gfx/platform_canvas_linux.cc
===================================================================
--- base/gfx/platform_canvas_linux.cc (revision 4951)
+++ base/gfx/platform_canvas_linux.cc (working copy)
@@ -15,16 +15,21 @@
PlatformCanvasLinux::PlatformCanvasLinux(int width, int height, bool is_opaque)
: SkCanvas() {
- initialize(width, height, is_opaque);
+ if (!initialize(width, height, is_opaque))
+ CHECK(false);
}
PlatformCanvasLinux::~PlatformCanvasLinux() {
}
-void PlatformCanvasLinux::initialize(int width, int height, bool is_opaque) {
+bool PlatformCanvasLinux::initialize(int width, int height, bool is_opaque) {
SkDevice* device = createPlatformDevice(width, height, is_opaque);
+ if (!device)
+ return false;
+
setDevice(device);
device->unref(); // was created with refcount 1, and setDevice also refs
+ return true;
}
PlatformDeviceLinux& PlatformCanvasLinux::getTopPlatformDevice() const {
« no previous file with comments | « base/gfx/platform_canvas_linux.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698