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/GrAAConvexPathRenderer.cpp

Issue 12379052: Remove constructors from GrVertexAttrib (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/gpu/GrAAHairLinePathRenderer.cpp » ('j') | src/gpu/GrContext.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 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 #include "GrAAConvexPathRenderer.h" 9 #include "GrAAConvexPathRenderer.h"
10 10
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 }; 473 };
474 SkSTArray<kPreallocSegmentCnt, Segment, true> segments; 474 SkSTArray<kPreallocSegmentCnt, Segment, true> segments;
475 SkPoint fanPt; 475 SkPoint fanPt;
476 476
477 if (!get_segments(*path, *vm, &segments, &fanPt, &vCount, &iCount)) { 477 if (!get_segments(*path, *vm, &segments, &fanPt, &vCount, &iCount)) {
478 return false; 478 return false;
479 } 479 }
480 480
481 // position + edge 481 // position + edge
482 static const GrVertexAttrib kAttribs[] = { 482 static const GrVertexAttrib kAttribs[] = {
483 GrVertexAttrib(kVec2f_GrVertexAttribType, 0), 483 {kVec2f_GrVertexAttribType, 0},
484 GrVertexAttrib(kVec4f_GrVertexAttribType, sizeof(GrPoint)) 484 {kVec4f_GrVertexAttribType, sizeof(GrPoint)}
485 }; 485 };
486 static const GrAttribBindings bindings = GrDrawState::kEdge_AttribBindingsBi t; 486 static const GrAttribBindings bindings = GrDrawState::kEdge_AttribBindingsBi t;
487 487
488 drawState->setVertexAttribs(kAttribs, SK_ARRAY_COUNT(kAttribs)); 488 drawState->setVertexAttribs(kAttribs, SK_ARRAY_COUNT(kAttribs));
489 drawState->setAttribIndex(GrDrawState::kPosition_AttribIndex, 0); 489 drawState->setAttribIndex(GrDrawState::kPosition_AttribIndex, 0);
490 drawState->setAttribIndex(GrDrawState::kEdge_AttribIndex, 1); 490 drawState->setAttribIndex(GrDrawState::kEdge_AttribIndex, 1);
491 drawState->setAttribBindings(bindings); 491 drawState->setAttribBindings(bindings);
492 GrDrawTarget::AutoReleaseGeometry arg(target, vCount, iCount); 492 GrDrawTarget::AutoReleaseGeometry arg(target, vCount, iCount);
493 if (!arg.succeeded()) { 493 if (!arg.succeeded()) {
494 return false; 494 return false;
495 } 495 }
496 GrAssert(sizeof(QuadVertex) == drawState->getVertexSize()); 496 GrAssert(sizeof(QuadVertex) == drawState->getVertexSize());
497 verts = reinterpret_cast<QuadVertex*>(arg.vertices()); 497 verts = reinterpret_cast<QuadVertex*>(arg.vertices());
498 idxs = reinterpret_cast<uint16_t*>(arg.indices()); 498 idxs = reinterpret_cast<uint16_t*>(arg.indices());
499 499
500 create_vertices(segments, fanPt, verts, idxs); 500 create_vertices(segments, fanPt, verts, idxs);
501 501
502 GrDrawState::VertexEdgeType oldEdgeType = drawState->getVertexEdgeType(); 502 GrDrawState::VertexEdgeType oldEdgeType = drawState->getVertexEdgeType();
503 drawState->setVertexEdgeType(GrDrawState::kQuad_EdgeType); 503 drawState->setVertexEdgeType(GrDrawState::kQuad_EdgeType);
504 target->drawIndexed(kTriangles_GrPrimitiveType, 504 target->drawIndexed(kTriangles_GrPrimitiveType,
505 0, // start vertex 505 0, // start vertex
506 0, // start index 506 0, // start index
507 vCount, 507 vCount,
508 iCount); 508 iCount);
509 drawState->setVertexEdgeType(oldEdgeType); 509 drawState->setVertexEdgeType(oldEdgeType);
510 510
511 return true; 511 return true;
512 } 512 }
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrAAHairLinePathRenderer.cpp » ('j') | src/gpu/GrContext.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698