OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 // This test only works with the GPU backend. | 9 // This test only works with the GPU backend. |
10 | 10 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 size_t vertexStride = this->geometryProcessor()->getVertexStride(); | 55 size_t vertexStride = this->geometryProcessor()->getVertexStride(); |
56 | 56 |
57 const GrVertexBuffer* vertexBuffer; | 57 const GrVertexBuffer* vertexBuffer; |
58 int firstVertex; | 58 int firstVertex; |
59 | 59 |
60 void* vertices = batchTarget->vertexPool()->makeSpace(vertexStride, | 60 void* vertices = batchTarget->vertexPool()->makeSpace(vertexStride, |
61 kVertsPerCubic, | 61 kVertsPerCubic, |
62 &vertexBuffer, | 62 &vertexBuffer, |
63 &firstVertex); | 63 &firstVertex); |
64 | 64 |
| 65 if (!vertices || !batchTarget->quadIndexBuffer()) { |
| 66 SkDebugf("Could not allocate buffers\n"); |
| 67 return; |
| 68 } |
| 69 |
65 SkASSERT(vertexStride == sizeof(SkPoint)); | 70 SkASSERT(vertexStride == sizeof(SkPoint)); |
66 SkPoint* verts = reinterpret_cast<SkPoint*>(vertices); | 71 SkPoint* verts = reinterpret_cast<SkPoint*>(vertices); |
67 | 72 |
68 // Make sure any artifacts around the exterior of path are visible by us
ing overly | 73 // Make sure any artifacts around the exterior of path are visible by us
ing overly |
69 // conservative bounding geometry. | 74 // conservative bounding geometry. |
70 fGeometry.fBounds.outset(5.f, 5.f); | 75 fGeometry.fBounds.outset(5.f, 5.f); |
71 fGeometry.fBounds.toQuad(verts); | 76 fGeometry.fBounds.toQuad(verts); |
72 | 77 |
73 GrDrawTarget::DrawInfo drawInfo; | 78 GrDrawTarget::DrawInfo drawInfo; |
74 drawInfo.setPrimitiveType(kTriangleFan_GrPrimitiveType); | 79 drawInfo.setPrimitiveType(kTriangleFan_GrPrimitiveType); |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 SkTLList<SkPath> fPaths; | 284 SkTLList<SkPath> fPaths; |
280 SkTLList<SkRect> fRects; | 285 SkTLList<SkRect> fRects; |
281 | 286 |
282 typedef GM INHERITED; | 287 typedef GM INHERITED; |
283 }; | 288 }; |
284 | 289 |
285 DEF_GM( return SkNEW(ConvexPolyEffect); ) | 290 DEF_GM( return SkNEW(ConvexPolyEffect); ) |
286 } | 291 } |
287 | 292 |
288 #endif | 293 #endif |
OLD | NEW |