Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: gm/convexpolyeffect.cpp

Issue 979343002: handle null vertex or index buffers in batch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: cleanup Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gm/beziereffects.cpp ('k') | src/gpu/GrAAConvexPathRenderer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « gm/beziereffects.cpp ('k') | src/gpu/GrAAConvexPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698