&vertexBuffer,
&firstVertex);
+ if (!vertices || !batchTarget->quadIndexBuffer()) {
+ SkDebugf("Could not allocate buffers\n");
+ return;
+ }
+
SkASSERT(vertexStride == sizeof(Vertex));
Vertex* verts = reinterpret_cast<Vertex*>(vertices);
&vertexBuffer,
&firstVertex);
+ if (!vertices || !batchTarget->quadIndexBuffer()) {
+ SkDebugf("Could not allocate buffers\n");
+ return;
+ }
+
SkASSERT(vertexStride == sizeof(Vertex));
Vertex* verts = reinterpret_cast<Vertex*>(vertices);
&vertexBuffer,
&firstVertex);
+ if (!vertices || !batchTarget->quadIndexBuffer()) {
+ SkDebugf("Could not allocate buffers\n");
+ return;
+ }
+
SkASSERT(vertexStride == sizeof(SkPoint));
SkPoint* verts = reinterpret_cast<SkPoint*>(vertices);
&vertexBuffer,
&firstVertex);
+ if (!vertices) {
+ SkDebugf("Could not allocate vertices\n");
+ return;
+ }
+
const GrIndexBuffer* indexBuffer;
int firstIndex;
&indexBuffer,
&firstIndex);
+ if (!indices) {
+ SkDebugf("Could not allocate indices\n");
+ return;
+ }
+
QuadVertex* verts = reinterpret_cast<QuadVertex*>(vertices);
uint16_t* idxs = reinterpret_cast<uint16_t*>(indices);
&vertexBuffer,
&firstVertex);
+ if (!vertices) {
+ SkDebugf("Could not allocate vertices\n");
+ return;
+ }
+
SkASSERT(lineGP->getVertexStride() == sizeof(LineVertex));
LineVertex* verts = reinterpret_cast<LineVertex*>(vertices);
&vertexBuffer,
&firstVertex);
+ if (!vertices) {
+ SkDebugf("Could not allocate vertices\n");
+ return;
+ }
+
// Setup vertices
BezierVertex* verts = reinterpret_cast<BezierVertex*>(vertices);
const SkPath& path,
const SkStrokeRec& stroke,
bool) {
+ if (!fLinesIndexBuffer || !fQuadsIndexBuffer) {
+ SkDebugf("unable to allocate indices\n");
+ return false;
+ }
+
SkScalar hairlineCoverage;
uint8_t newCoverage = 0xff;
if (IsStrokeHairlineOrEquivalent(stroke, viewMatrix, &hairlineCoverage)) {
&vertexBuffer,
&firstVertex);
+ if (!vertices) {
+ SkDebugf("Could not allocate vertices\n");
+ return;
+ }
+
for (int i = 0; i < instanceCount; i++) {
const Geometry& args = fGeoData[i];
this->generateAAFillRectGeometry(vertices,
const SkMatrix& viewMatrix,
const SkRect& rect,
const SkRect& devRect) {
- if (NULL == fAAFillRectIndexBuffer) {
+ if (!fAAFillRectIndexBuffer) {
fAAFillRectIndexBuffer = fGpu->createInstancedIndexBuffer(gFillAARectIdx,
kIndicesPerAAFillRect,
kNumAAFillRectsInIndexBuffer,
kVertsPerAAFillRect);
}
+ if (!fAAFillRectIndexBuffer) {
+ SkDebugf("Unable to create index buffer\n");
+ return;
+ }
+
AAFillRectBatch::Geometry geometry;
geometry.fRect = rect;
geometry.fViewMatrix = viewMatrix;
&vertexBuffer,
&firstVertex);
+ if (!vertices) {
+ SkDebugf("Could not allocate vertices\n");
+ return;
+ }
+
for (int i = 0; i < instanceCount; i++) {
const Geometry& args = fGeoData[i];
this->generateAAStrokeRectGeometry(vertices,
const SkRect& devInside,
bool miterStroke) {
GrIndexBuffer* indexBuffer = this->aaStrokeRectIndexBuffer(miterStroke);
- if (NULL == indexBuffer) {
+ if (!indexBuffer) {
SkDebugf("Failed to create index buffer!\n");
return;
}
&vertexBuffer,
&firstVertex);
+ if (!vertices) {
+ SkDebugf("Could not allocate vertices\n");
+ return;
+ }
+
SkPoint* vertex = reinterpret_cast<SkPoint*>(vertices);
GrPrimitiveType primType;
&vertexBuffer,
&firstVertex);
+ if (!vertices) {
+ SkDebugf("Could not allocate vertices\n");
+ return;
+ }
+
const GrIndexBuffer* indexBuffer;
int firstIndex;
indices = batchTarget->indexPool()->makeSpace(this->indexCount(),
&indexBuffer,
&firstIndex);
+
+ if (!indices) {
+ SkDebugf("Could not allocate indices\n");
+ return;
+ }
}
int indexOffset = 0;
&vertexBuffer,
&firstVertex);
+ if (!vertices) {
+ SkDebugf("Could not allocate vertices\n");
+ return;
+ }
+
const GrIndexBuffer* indexBuffer;
int firstIndex;
indices = batchTarget->indexPool()->makeSpace(maxIndices,
&indexBuffer,
&firstIndex);
+
+ if (!indices) {
+ SkDebugf("Could not allocate indices\n");
+ return;
+ }
}
// fill buffers
&vertexBuffer,
&firstVertex);
+ if (!vertices || !batchTarget->quadIndexBuffer()) {
+ SkDebugf("Could not allocate buffers\n");
+ return;
+ }
+
for (int i = 0; i < instanceCount; i++) {
const Geometry& args = fGeoData[i];
&vertexBuffer,
&firstVertex);
+ if (!vertices || !batchTarget->quadIndexBuffer()) {
+ SkDebugf("Could not allocate buffers\n");
+ return;
+ }
+
CircleVertex* verts = reinterpret_cast<CircleVertex*>(vertices);
for (int i = 0; i < instanceCount; i++) {
&vertexBuffer,
&firstVertex);
+ if (!vertices || !batchTarget->quadIndexBuffer()) {
+ SkDebugf("Could not allocate buffers\n");
+ return;
+ }
+
EllipseVertex* verts = reinterpret_cast<EllipseVertex*>(vertices);
for (int i = 0; i < instanceCount; i++) {
&vertexBuffer,
&firstVertex);
+ if (!vertices || !batchTarget->quadIndexBuffer()) {
+ SkDebugf("Could not allocate buffers\n");
+ return;
+ }
+
DIEllipseVertex* verts = reinterpret_cast<DIEllipseVertex*>(vertices);
for (int i = 0; i < instanceCount; i++) {
&vertexBuffer,
&firstVertex);
+ if (!vertices) {
+ SkDebugf("Could not allocate vertices\n");
+ return;
+ }
+
CircleVertex* verts = reinterpret_cast<CircleVertex*>(vertices);
for (int i = 0; i < instanceCount; i++) {
&vertexBuffer,
&firstVertex);
+ if (!vertices) {
+ SkDebugf("Could not allocate vertices\n");
+ return;
+ }
+
EllipseVertex* verts = reinterpret_cast<EllipseVertex*>(vertices);
for (int i = 0; i < instanceCount; i++) {
count,
&vertexBuffer,
&firstVertex);
+
+ if (!vertices) {
+ SkDebugf("Could not allocate vertices\n");
+ return;
+ }
+
LOG("emitting %d verts\n", count);
void* end = polys_to_triangles(polys, fillType, vertices);
int actualCount = static_cast<int>(
&vertexBuffer,
&firstVertex);
+ if (!vertices || !batchTarget->quadIndexBuffer()) {
+ SkDebugf("Could not allocate buffers\n");
+ return;
+ }
+
int curVIdx = 0;
int rectIndex = 0;
for (int i = 0; i < instanceCount; i++) {