| OLD | NEW |
| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 } | 117 } |
| 118 | 118 |
| 119 class AAStrokeRectBatch : public GrVertexBatch { | 119 class AAStrokeRectBatch : public GrVertexBatch { |
| 120 public: | 120 public: |
| 121 DEFINE_BATCH_CLASS_ID | 121 DEFINE_BATCH_CLASS_ID |
| 122 | 122 |
| 123 AAStrokeRectBatch(GrColor color, const SkMatrix& viewMatrix, | 123 AAStrokeRectBatch(GrColor color, const SkMatrix& viewMatrix, |
| 124 const SkRect& devOutside, const SkRect& devInside) | 124 const SkRect& devOutside, const SkRect& devInside) |
| 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 this->setBounds(devOutside, HasAABloat::kYes, IsZeroArea::kNo); | 131 this->setBounds(devOutside, HasAABloat::kYes, IsZeroArea::kNo); |
| 132 fMiterStroke = true; | 132 fMiterStroke = true; |
| 133 } | 133 } |
| 134 | 134 |
| 135 static GrDrawBatch* Create(GrColor color, const SkMatrix& viewMatrix, const
SkRect& rect, | 135 static GrDrawBatch* Create(GrColor color, const SkMatrix& viewMatrix, const
SkRect& rect, |
| 136 const SkStrokeRec& stroke) { | 136 const SkStrokeRec& stroke) { |
| 137 bool isMiter; | 137 bool isMiter; |
| 138 if (!allowed_stroke(stroke, &isMiter)) { | 138 if (!allowed_stroke(stroke, &isMiter)) { |
| (...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 SkStrokeRec rec(SkStrokeRec::kFill_InitStyle); | 613 SkStrokeRec rec(SkStrokeRec::kFill_InitStyle); |
| 614 rec.setStrokeStyle(strokeWidth); | 614 rec.setStrokeStyle(strokeWidth); |
| 615 rec.setStrokeParams(SkPaint::kButt_Cap, | 615 rec.setStrokeParams(SkPaint::kButt_Cap, |
| 616 miterStroke ? SkPaint::kMiter_Join : SkPaint::kBevel_Joi
n, | 616 miterStroke ? SkPaint::kMiter_Join : SkPaint::kBevel_Joi
n, |
| 617 1.f); | 617 1.f); |
| 618 SkMatrix matrix = GrTest::TestMatrixRectStaysRect(random); | 618 SkMatrix matrix = GrTest::TestMatrixRectStaysRect(random); |
| 619 return GrAAStrokeRectBatch::Create(color, matrix, rect, rec); | 619 return GrAAStrokeRectBatch::Create(color, matrix, rect, rec); |
| 620 } | 620 } |
| 621 | 621 |
| 622 #endif | 622 #endif |
| OLD | NEW |