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
This commit is contained in:
bsalomon@google.com 2011-03-04 22:48:25 +00:00
parent 6f8f292aa7
commit bf4338cb3b
5 changed files with 17 additions and 12 deletions

View File

@ -50,7 +50,7 @@ public:
*
* @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

View File

@ -152,24 +152,24 @@ void GrPath::resetFromIter(GrPathIter* iter) {
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;

View File

@ -176,7 +176,7 @@ public:
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;

View File

@ -138,7 +138,7 @@ void SkGrPathIter::rewind() {
fIter.setPath(*fPath, false);
}
GrConvexHint SkGrPathIter::hint() const {
GrConvexHint SkGrPathIter::convexHint() const {
return fPath->isConvex() ? kConvex_ConvexHint :
kNone_ConvexHint;
}

View File

@ -439,11 +439,16 @@ bool SkOSWindow::attachGL(const SkBitmap* offscreen) {
}
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;
}