Fail draws when can't get geom into vb/ib.
Review URL: http://codereview.appspot.com/4837059/
git-svn-id: http://skia.googlecode.com/svn/trunk@2053 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/include/GrContext_impl.h b/gpu/include/GrContext_impl.h
index df16c8c..8596491 100644
--- a/gpu/include/GrContext_impl.h
+++ b/gpu/include/GrContext_impl.h
@@ -37,7 +37,7 @@
int indexCount = (NULL != idxSrc) ? idxSrc->count() : 0;
if (!geo.set(target, layout, vertexCount, indexCount)) {
- GrPrintf("Failed to get space for vertices!");
+ GrPrintf("Failed to get space for vertices!\n");
return;
}
diff --git a/gpu/include/GrDrawTarget.h b/gpu/include/GrDrawTarget.h
index 4431dc0..8196beb 100644
--- a/gpu/include/GrDrawTarget.h
+++ b/gpu/include/GrDrawTarget.h
@@ -938,10 +938,10 @@
int vertexCount,
int indexCount);
bool succeeded() const { return NULL != fTarget; }
- void* vertices() const { return fVertices; }
- void* indices() const { return fIndices; }
+ void* vertices() const { GrAssert(this->succeeded()); return fVertices; }
+ void* indices() const { GrAssert(this->succeeded()); return fIndices; }
GrPoint* positions() const {
- return static_cast<GrPoint*>(fVertices);
+ return static_cast<GrPoint*>(this->vertices());
}
private: