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

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

Issue 502533004: Revert of 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
« no previous file with comments | « src/gpu/GrAAConvexPathRenderer.cpp ('k') | src/gpu/GrAARectRenderer.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 * 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));
735 sizeof(LineVertex)); 735 SkASSERT(sizeof(LineVertex) == drawState->getVertexSize());
736 736
737 if (!arg->set(target, vertCnt, 0)) { 737 if (!arg->set(target, vertCnt, 0)) {
738 return false; 738 return false;
739 } 739 }
740 740
741 LineVertex* verts = reinterpret_cast<LineVertex*>(arg->vertices()); 741 LineVertex* verts = reinterpret_cast<LineVertex*>(arg->vertices());
742 742
743 const SkMatrix* toSrc = NULL; 743 const SkMatrix* toSrc = NULL;
744 SkMatrix ivm; 744 SkMatrix ivm;
745 745
(...skipping 25 matching lines...) Expand all
771 const IntArray& qSubdivs, 771 const IntArray& qSubdivs,
772 const FloatArray& cWeights, 772 const FloatArray& cWeights,
773 GrDrawTarget::AutoReleaseGeometry* arg , 773 GrDrawTarget::AutoReleaseGeometry* arg ,
774 SkRect* devBounds) { 774 SkRect* devBounds) {
775 GrDrawState* drawState = target->drawState(); 775 GrDrawState* drawState = target->drawState();
776 776
777 const SkMatrix& viewM = drawState->getViewMatrix(); 777 const SkMatrix& viewM = drawState->getViewMatrix();
778 778
779 int vertCnt = kVertsPerQuad * quadCnt + kVertsPerQuad * conicCnt; 779 int vertCnt = kVertsPerQuad * quadCnt + kVertsPerQuad * conicCnt;
780 780
781 int vAttribCnt = SK_ARRAY_COUNT(gHairlineBezierAttribs); 781 target->drawState()->setVertexAttribs<gHairlineBezierAttribs>(SK_ARRAY_COUNT (gHairlineBezierAttribs));
782 target->drawState()->setVertexAttribs<gHairlineBezierAttribs>(vAttribCnt, si zeof(BezierVertex)); 782 SkASSERT(sizeof(BezierVertex) == target->getDrawState().getVertexSize());
783 783
784 if (!arg->set(target, vertCnt, 0)) { 784 if (!arg->set(target, vertCnt, 0)) {
785 return false; 785 return false;
786 } 786 }
787 787
788 BezierVertex* verts = reinterpret_cast<BezierVertex*>(arg->vertices()); 788 BezierVertex* verts = reinterpret_cast<BezierVertex*>(arg->vertices());
789 789
790 const SkMatrix* toDevice = NULL; 790 const SkMatrix* toDevice = NULL;
791 const SkMatrix* toSrc = NULL; 791 const SkMatrix* toSrc = NULL;
792 SkMatrix ivm; 792 SkMatrix ivm;
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
1033 &devBounds); 1033 &devBounds);
1034 conics += n; 1034 conics += n;
1035 } 1035 }
1036 } 1036 }
1037 } 1037 }
1038 1038
1039 target->resetIndexSource(); 1039 target->resetIndexSource();
1040 1040
1041 return true; 1041 return true;
1042 } 1042 }
OLDNEW
« no previous file with comments | « src/gpu/GrAAConvexPathRenderer.cpp ('k') | src/gpu/GrAARectRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698