diff options
Diffstat (limited to 'app/gfx')
-rw-r--r-- | app/gfx/path.h | 1 | ||||
-rw-r--r-- | app/gfx/path_gtk.cc | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/app/gfx/path.h b/app/gfx/path.h index 96ae427..8062e34 100644 --- a/app/gfx/path.h +++ b/app/gfx/path.h @@ -28,6 +28,7 @@ class Path : public SkPath { #elif defined(OS_LINUX) // Creates a Gdkregion from the path. The caller is responsible for freeing // resources used by this region. This only supports polygon paths. + // WARNING: this returns NULL for an empty Path. GdkRegion* CreateGdkRegion() const; #endif diff --git a/app/gfx/path_gtk.cc b/app/gfx/path_gtk.cc index bc35857..9a2b92c 100644 --- a/app/gfx/path_gtk.cc +++ b/app/gfx/path_gtk.cc @@ -7,11 +7,18 @@ #include <gdk/gdk.h> #include "base/scoped_ptr.h" +#include "base/command_line.h" namespace gfx { GdkRegion* Path::CreateGdkRegion() const { int point_count = getPoints(NULL, 0); + if (point_count <= 1) { + // NOTE: ideally this would return gdk_empty_region, but that returns a + // region with nothing in it. + return NULL; + } + scoped_array<SkPoint> points(new SkPoint[point_count]); getPoints(points.get(), point_count); |