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

Side by Side Diff: src/gpu/batches/GrAAStrokeRectBatch.cpp

Issue 2126893002: Hide NonAAStrokeRectBatch Geometry class and cleanup class. (Closed) Base URL: https://chromium.googlesource.com/skia.git@aastrokerectbatch
Patch Set: rebase Created 4 years, 5 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 | « no previous file | src/gpu/batches/GrNonAAStrokeRectBatch.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 2015 Google Inc. 2 * Copyright 2015 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 "GrAAStrokeRectBatch.h" 8 #include "GrAAStrokeRectBatch.h"
9 9
10 #include "GrBatchFlushState.h" 10 #include "GrBatchFlushState.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 : INHERITED(ClassID()) 125 : INHERITED(ClassID())
126 , fViewMatrix(viewMatrix) { 126 , fViewMatrix(viewMatrix) {
127 SkASSERT(!devOutside.isEmpty()) 127 SkASSERT(!devOutside.isEmpty())
128 SkASSERT(!devInside.isEmpty()) 128 SkASSERT(!devInside.isEmpty())
129 129
130 fGeoData.emplace_back(Geometry{color, devOutside, devOutside, devInside, false}); 130 fGeoData.emplace_back(Geometry{color, devOutside, devOutside, devInside, false});
131 fBounds = devOutside; 131 fBounds = devOutside;
132 fMiterStroke = true; 132 fMiterStroke = true;
133 } 133 }
134 134
135
136 static GrDrawBatch* Create(GrColor color, const SkMatrix& viewMatrix, const SkRect& rect, 135 static GrDrawBatch* Create(GrColor color, const SkMatrix& viewMatrix, const SkRect& rect,
137 const SkStrokeRec& stroke) { 136 const SkStrokeRec& stroke) {
138 bool isMiter; 137 bool isMiter;
139 if (!allowed_stroke(stroke, &isMiter)) { 138 if (!allowed_stroke(stroke, &isMiter)) {
140 return nullptr; 139 return nullptr;
141 } 140 }
142 141
143 AAStrokeRectBatch* batch = new AAStrokeRectBatch(); 142 AAStrokeRectBatch* batch = new AAStrokeRectBatch();
144 batch->fMiterStroke = isMiter; 143 batch->fMiterStroke = isMiter;
145 Geometry& geo = batch->fGeoData.push_back(); 144 Geometry& geo = batch->fGeoData.push_back();
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 SkStrokeRec rec(SkStrokeRec::kFill_InitStyle); 614 SkStrokeRec rec(SkStrokeRec::kFill_InitStyle);
616 rec.setStrokeStyle(strokeWidth); 615 rec.setStrokeStyle(strokeWidth);
617 rec.setStrokeParams(SkPaint::kButt_Cap, 616 rec.setStrokeParams(SkPaint::kButt_Cap,
618 miterStroke ? SkPaint::kMiter_Join : SkPaint::kBevel_Joi n, 617 miterStroke ? SkPaint::kMiter_Join : SkPaint::kBevel_Joi n,
619 1.f); 618 1.f);
620 SkMatrix matrix = GrTest::TestMatrixRectStaysRect(random); 619 SkMatrix matrix = GrTest::TestMatrixRectStaysRect(random);
621 return GrAAStrokeRectBatch::Create(color, matrix, rect, rec); 620 return GrAAStrokeRectBatch::Create(color, matrix, rect, rec);
622 } 621 }
623 622
624 #endif 623 #endif
OLDNEW
« no previous file with comments | « no previous file | src/gpu/batches/GrNonAAStrokeRectBatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698