Bug 817846 - Add BaseSize::IsEmpty() member function. r=cjones
authorUsurelu Catalin <catalin.usurelu5@gmail.com>
Thu, 24 Jan 2013 18:10:27 -0500
changeset 119703 8ff961a90f5e49370311c94b7e884aa9bc52d9d8
parent 119702 ad26cf59d3049c6101d42a41f9520e18b9c1a474
child 119704 7d54dfb620301c85b735c9cf6e152d801656ce01
push id24219
push userryanvm@gmail.com
push dateThu, 24 Jan 2013 17:36:06 +0000
treeherdermozilla-central@fa969919b1bb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscjones
bugs817846
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 817846 - Add BaseSize::IsEmpty() member function. r=cjones
gfx/2d/BaseSize.h
--- a/gfx/2d/BaseSize.h
+++ b/gfx/2d/BaseSize.h
@@ -19,16 +19,20 @@ struct BaseSize {
   T width, height;
 
   // Constructors
   BaseSize() : width(0), height(0) {}
   BaseSize(T aWidth, T aHeight) : width(aWidth), height(aHeight) {}
 
   void SizeTo(T aWidth, T aHeight) { width = aWidth; height = aHeight; }
 
+  bool IsEmpty() const {
+    return width == 0 || height == 0;
+  }
+
   // Note that '=' isn't defined so we'll get the
   // compiler generated default assignment operator
 
   bool operator==(const Sub& aSize) const {
     return width == aSize.width && height == aSize.height;
   }
   bool operator!=(const Sub& aSize) const {
     return width != aSize.width || height != aSize.height;