add isConvex() hit to SkPath, to be used to speed up fills and opengl
set linewidth in gldevice for hair rects
remove some cruft from samples
add more gl-unimpl messages



git-svn-id: http://skia.googlecode.com/svn/trunk@199 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
index 0cb50fb..2127bb4 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -28,6 +28,9 @@
     It captures some state about the path up front (i.e. if it already has a
     cached bounds), and the if it can, it updates the cache bounds explicitly,
     avoiding the need to revisit all of the points in getBounds().
+ 
+    It also notes if the path was originally empty, and if so, sets isConvex
+    to true. Thus it can only be used if the contour being added is convex.
  */
 class SkAutoPathBoundsUpdate {
 public:
@@ -42,6 +45,7 @@
     }
     
     ~SkAutoPathBoundsUpdate() {
+        fPath->setIsConvex(fEmpty);
         if (fEmpty) {
             fPath->fBounds = fRect;
             fPath->fBoundsIsDirty = false;
@@ -52,13 +56,13 @@
     }
     
 private:
-    const SkPath*   fPath;
-    SkRect          fRect;
-    bool            fDirty;
-    bool            fEmpty;
+    SkPath* fPath;
+    SkRect  fRect;
+    bool    fDirty;
+    bool    fEmpty;
     
     // returns true if we should proceed
-    void init(const SkPath* path) {
+    void init(SkPath* path) {
         fPath = path;
         fDirty = path->fBoundsIsDirty;
         fEmpty = path->isEmpty();
@@ -91,7 +95,9 @@
 
 ////////////////////////////////////////////////////////////////////////////
 
-SkPath::SkPath() : fBoundsIsDirty(true), fFillType(kWinding_FillType) {}
+SkPath::SkPath() : fBoundsIsDirty(true), fFillType(kWinding_FillType) {
+    fIsConvex = false;
+}
 
 SkPath::SkPath(const SkPath& src) {
     SkDEBUGCODE(src.validate();)
@@ -111,12 +117,15 @@
         fVerbs          = src.fVerbs;
         fFillType       = src.fFillType;
         fBoundsIsDirty  = src.fBoundsIsDirty;
+        fIsConvex       = src.fIsConvex;
     }
     SkDEBUGCODE(this->validate();)
     return *this;
 }
 
 bool operator==(const SkPath& a, const SkPath& b) {
+    // note: don't need to look at isConvex or bounds, since just comparing the
+    // raw data is sufficient.
     return &a == &b ||
         (a.fFillType == b.fFillType && a.fVerbs == b.fVerbs && a.fPts == b.fPts);
 }
@@ -130,6 +139,7 @@
         fVerbs.swap(other.fVerbs);
         SkTSwap<uint8_t>(fFillType, other.fFillType);
         SkTSwap<uint8_t>(fBoundsIsDirty, other.fBoundsIsDirty);
+        SkTSwap<uint8_t>(fIsConvex, other.fIsConvex);
     }
 }