Skip to content
This repository has been archived by the owner on Sep 25, 2019. It is now read-only.

Commit

Permalink
Make PlatformCanvasLinux match up with recent changes in the Windows …
Browse files Browse the repository at this point in the history
…one, which is able to report allocation failures.

Review URL: http://codereview.chromium.org/9510

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4991 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
brettw@google.com committed Nov 7, 2008
1 parent e89deeb commit 19eeebe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions base/gfx/platform_canvas_linux.cc
Expand Up @@ -15,16 +15,21 @@ PlatformCanvasLinux::PlatformCanvasLinux() : SkCanvas() {

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 {
Expand Down
2 changes: 1 addition & 1 deletion base/gfx/platform_canvas_linux.h
Expand Up @@ -27,7 +27,7 @@ class PlatformCanvasLinux : public SkCanvas {
virtual ~PlatformCanvasLinux();

// For two-part init, call if you use the no-argument constructor above
void initialize(int width, int height, bool is_opaque);
bool initialize(int width, int height, bool is_opaque);

// Returns the platform device pointer of the topmost rect with a non-empty
// clip. Both the windows and mac versions have an equivalent of this method;
Expand Down

0 comments on commit 19eeebe

Please sign in to comment.