Fix Sample App on Win32 GL window resize, fix sk->gr convexity hint, fix grpath uninit warnings

Review URL http://codereview.appspot.com/4247055/


git-svn-id: http://skia.googlecode.com/svn/trunk@895 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/include/GrPathIter.h b/gpu/include/GrPathIter.h
index f310184..55427c0 100644
--- a/gpu/include/GrPathIter.h
+++ b/gpu/include/GrPathIter.h
@@ -50,7 +50,7 @@
      *
      * @return a hint about the convexity of the path.
      */
-    virtual GrConvexHint convexHint() const { return kNone_ConvexHint; }
+    virtual GrConvexHint convexHint() const = 0;
 
      /**
       * Iterates through the path. Should not be called after
diff --git a/gpu/src/GrPath.cpp b/gpu/src/GrPath.cpp
index 019b2fd..1e5a6cf 100644
--- a/gpu/src/GrPath.cpp
+++ b/gpu/src/GrPath.cpp
@@ -152,24 +152,24 @@
     fConvexHint = iter->convexHint();
 
     // first point of the subpath
-    GrPoint firstPt;
+    GrPoint firstPt(0,0);
     // first edge of the subpath
-    GrVec firstVec;
+    GrVec firstVec(0,0);
     // vec of most recently processed edge, that wasn't degenerate
-    GrVec previousVec;
+    GrVec previousVec(0,0);
     // most recently processed point
-    GrPoint previousPt;
+    GrPoint previousPt(0,0);
 
     // sign indicates whether we're bending left or right
-    GrScalar turnDir;
+    GrScalar turnDir = 0;
     // number of times the direction has flipped in x or y
 
     // we track which direction we are moving in x/y and the
     // number of times it changes.
-    int xDir;
-    int yDir;
-    int flipX;
-    int flipY;
+    int xDir = 0;
+    int yDir = 0;
+    int flipX = 0;
+    int flipY = 0;
 
     // counts number of sub path pts that didn't add a degenerate edge.
     int subPathPts = 0;
diff --git a/include/gpu/SkGr.h b/include/gpu/SkGr.h
index a7c0c1d..6f5ebfe 100644
--- a/include/gpu/SkGr.h
+++ b/include/gpu/SkGr.h
@@ -176,7 +176,7 @@
     virtual GrPathCmd next(GrPoint pts[]);
     virtual GrPathCmd next();
     virtual void rewind();
-    virtual GrConvexHint hint() const;
+    virtual GrConvexHint convexHint() const;
 
     void reset(const SkPath& path) {
         fPath = &path;
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index 54d64a3..e57f88a 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -138,7 +138,7 @@
     fIter.setPath(*fPath, false);
 }
 
-GrConvexHint SkGrPathIter::hint() const {
+GrConvexHint SkGrPathIter::convexHint() const {
     return fPath->isConvex() ? kConvex_ConvexHint :
                                kNone_ConvexHint;
 }
diff --git a/src/utils/win/SkOSWindow_Win.cpp b/src/utils/win/SkOSWindow_Win.cpp
index 96a026d..d10f580 100644
--- a/src/utils/win/SkOSWindow_Win.cpp
+++ b/src/utils/win/SkOSWindow_Win.cpp
@@ -439,11 +439,16 @@
     }
     if (NULL == fHGLRC) {
         fHGLRC = create_gl((HWND)fHWND);
+        glClearStencil(0);
+        glClearColor(0, 0, 0, 0);
+        glStencilMask(0xffffffff);
+        glClear(GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
         if (NULL == fHGLRC) {
             return false;
         }
     }
     if (wglMakeCurrent(GetDC((HWND)fHWND), (HGLRC)fHGLRC)) {
+        glViewport(0, 0, this->width(), this->height());
         fGLAttached = true;
         return true;
     }