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

Side by Side Diff: src/gpu/effects/GrDashingEffect.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 | « src/gpu/GrTessellatingPathRenderer.cpp ('k') | no next file » | 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 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrDashingEffect.h" 8 #include "GrDashingEffect.h"
9 9
10 #include "GrBatch.h" 10 #include "GrBatch.h"
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 529
530 const GrVertexBuffer* vertexBuffer; 530 const GrVertexBuffer* vertexBuffer;
531 int firstVertex; 531 int firstVertex;
532 532
533 size_t vertexStride = gp->getVertexStride(); 533 size_t vertexStride = gp->getVertexStride();
534 void* vertices = batchTarget->vertexPool()->makeSpace(vertexStride, 534 void* vertices = batchTarget->vertexPool()->makeSpace(vertexStride,
535 totalRectCount * k VertsPerDash, 535 totalRectCount * k VertsPerDash,
536 &vertexBuffer, 536 &vertexBuffer,
537 &firstVertex); 537 &firstVertex);
538 538
539 if (!vertices || !batchTarget->quadIndexBuffer()) {
540 SkDebugf("Could not allocate buffers\n");
541 return;
542 }
543
539 int curVIdx = 0; 544 int curVIdx = 0;
540 int rectIndex = 0; 545 int rectIndex = 0;
541 for (int i = 0; i < instanceCount; i++) { 546 for (int i = 0; i < instanceCount; i++) {
542 Geometry& args = fGeoData[i]; 547 Geometry& args = fGeoData[i];
543 548
544 if (!draws[i].fLineDone) { 549 if (!draws[i].fLineDone) {
545 if (fullDash) { 550 if (fullDash) {
546 setup_dashed_rect(rects[rectIndex], vertices, curVIdx, args. fSrcRotInv, 551 setup_dashed_rect(rects[rectIndex], vertices, curVIdx, args. fSrcRotInv,
547 draws[i].fStartOffset, draws[i].fDevBloat, 552 draws[i].fStartOffset, draws[i].fDevBloat,
548 draws[i].fLineLength, draws[i].fHalfDevStr oke, 553 draws[i].fLineLength, draws[i].fHalfDevStr oke,
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after
1252 switch (cap) { 1257 switch (cap) {
1253 case kRound_DashCap: 1258 case kRound_DashCap:
1254 return DashingCircleEffect::Create(color, edgeType, localMatrix); 1259 return DashingCircleEffect::Create(color, edgeType, localMatrix);
1255 case kNonRound_DashCap: 1260 case kNonRound_DashCap:
1256 return DashingLineEffect::Create(color, edgeType, localMatrix); 1261 return DashingLineEffect::Create(color, edgeType, localMatrix);
1257 default: 1262 default:
1258 SkFAIL("Unexpected dashed cap."); 1263 SkFAIL("Unexpected dashed cap.");
1259 } 1264 }
1260 return NULL; 1265 return NULL;
1261 } 1266 }
OLDNEW
« no previous file with comments | « src/gpu/GrTessellatingPathRenderer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698