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

Side by Side Diff: src/gpu/GrAAHairLinePathRenderer.cpp

Issue 511593004: Make setVertexAttribs in GrDrawState take a stride parameter. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 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
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 "GrAAHairLinePathRenderer.h" 8 #include "GrAAHairLinePathRenderer.h"
9 9
10 #include "GrContext.h" 10 #include "GrContext.h"
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 const PtArray& lines, 724 const PtArray& lines,
725 int lineCnt, 725 int lineCnt,
726 GrDrawTarget::AutoReleaseGeometry* arg, 726 GrDrawTarget::AutoReleaseGeometry* arg,
727 SkRect* devBounds) { 727 SkRect* devBounds) {
728 GrDrawState* drawState = target->drawState(); 728 GrDrawState* drawState = target->drawState();
729 729
730 const SkMatrix& viewM = drawState->getViewMatrix(); 730 const SkMatrix& viewM = drawState->getViewMatrix();
731 731
732 int vertCnt = kVertsPerLineSeg * lineCnt; 732 int vertCnt = kVertsPerLineSeg * lineCnt;
733 733
734 drawState->setVertexAttribs<gHairlineLineAttribs>(SK_ARRAY_COUNT(gHairlineLi neAttribs)); 734 drawState->setVertexAttribs<gHairlineLineAttribs>(SK_ARRAY_COUNT(gHairlineLi neAttribs), sizeof(LineVertex));
bsalomon 2014/08/27 17:46:27 wrap?
egdaniel 2014/08/27 18:33:55 Done.
735 SkASSERT(sizeof(LineVertex) == drawState->getVertexSize());
736 735
737 if (!arg->set(target, vertCnt, 0)) { 736 if (!arg->set(target, vertCnt, 0)) {
738 return false; 737 return false;
739 } 738 }
740 739
741 LineVertex* verts = reinterpret_cast<LineVertex*>(arg->vertices()); 740 LineVertex* verts = reinterpret_cast<LineVertex*>(arg->vertices());
742 741
743 const SkMatrix* toSrc = NULL; 742 const SkMatrix* toSrc = NULL;
744 SkMatrix ivm; 743 SkMatrix ivm;
745 744
(...skipping 25 matching lines...) Expand all
771 const IntArray& qSubdivs, 770 const IntArray& qSubdivs,
772 const FloatArray& cWeights, 771 const FloatArray& cWeights,
773 GrDrawTarget::AutoReleaseGeometry* arg , 772 GrDrawTarget::AutoReleaseGeometry* arg ,
774 SkRect* devBounds) { 773 SkRect* devBounds) {
775 GrDrawState* drawState = target->drawState(); 774 GrDrawState* drawState = target->drawState();
776 775
777 const SkMatrix& viewM = drawState->getViewMatrix(); 776 const SkMatrix& viewM = drawState->getViewMatrix();
778 777
779 int vertCnt = kVertsPerQuad * quadCnt + kVertsPerQuad * conicCnt; 778 int vertCnt = kVertsPerQuad * quadCnt + kVertsPerQuad * conicCnt;
780 779
781 target->drawState()->setVertexAttribs<gHairlineBezierAttribs>(SK_ARRAY_COUNT (gHairlineBezierAttribs)); 780 int vAttribCnt = SK_ARRAY_COUNT(gHairlineBezierAttribs);
782 SkASSERT(sizeof(BezierVertex) == target->getDrawState().getVertexSize()); 781 target->drawState()->setVertexAttribs<gHairlineBezierAttribs>(vAttribCnt, si zeof(BezierVertex));
783 782
784 if (!arg->set(target, vertCnt, 0)) { 783 if (!arg->set(target, vertCnt, 0)) {
785 return false; 784 return false;
786 } 785 }
787 786
788 BezierVertex* verts = reinterpret_cast<BezierVertex*>(arg->vertices()); 787 BezierVertex* verts = reinterpret_cast<BezierVertex*>(arg->vertices());
789 788
790 const SkMatrix* toDevice = NULL; 789 const SkMatrix* toDevice = NULL;
791 const SkMatrix* toSrc = NULL; 790 const SkMatrix* toSrc = NULL;
792 SkMatrix ivm; 791 SkMatrix ivm;
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
1033 &devBounds); 1032 &devBounds);
1034 conics += n; 1033 conics += n;
1035 } 1034 }
1036 } 1035 }
1037 } 1036 }
1038 1037
1039 target->resetIndexSource(); 1038 target->resetIndexSource();
1040 1039
1041 return true; 1040 return true;
1042 } 1041 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698