| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "GrSWMaskHelper.h" | 8 #include "GrSWMaskHelper.h" |
| 9 | 9 |
| 10 #include "GrCaps.h" | 10 #include "GrCaps.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 | 120 |
| 121 /** | 121 /** |
| 122 * Draw a single path element of the clip stack into the accumulation bitmap | 122 * Draw a single path element of the clip stack into the accumulation bitmap |
| 123 */ | 123 */ |
| 124 void GrSWMaskHelper::draw(const SkPath& path, const SkStrokeRec& stroke, SkRegio
n::Op op, | 124 void GrSWMaskHelper::draw(const SkPath& path, const SkStrokeRec& stroke, SkRegio
n::Op op, |
| 125 bool antiAlias, uint8_t alpha) { | 125 bool antiAlias, uint8_t alpha) { |
| 126 | 126 |
| 127 SkPaint paint; | 127 SkPaint paint; |
| 128 if (stroke.isHairlineStyle()) { | 128 if (stroke.isHairlineStyle()) { |
| 129 paint.setStyle(SkPaint::kStroke_Style); | 129 paint.setStyle(SkPaint::kStroke_Style); |
| 130 paint.setStrokeWidth(SK_Scalar1); | |
| 131 } else { | 130 } else { |
| 132 if (stroke.isFillStyle()) { | 131 if (stroke.isFillStyle()) { |
| 133 paint.setStyle(SkPaint::kFill_Style); | 132 paint.setStyle(SkPaint::kFill_Style); |
| 134 } else { | 133 } else { |
| 135 paint.setStyle(SkPaint::kStroke_Style); | 134 paint.setStyle(SkPaint::kStroke_Style); |
| 136 paint.setStrokeJoin(stroke.getJoin()); | 135 paint.setStrokeJoin(stroke.getJoin()); |
| 137 paint.setStrokeCap(stroke.getCap()); | 136 paint.setStrokeCap(stroke.getCap()); |
| 138 paint.setStrokeWidth(stroke.getWidth()); | 137 paint.setStrokeWidth(stroke.getWidth()); |
| 139 } | 138 } |
| 140 } | 139 } |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 pipelineBuilder->addCoverageFragmentProcessor( | 361 pipelineBuilder->addCoverageFragmentProcessor( |
| 363 GrSimpleTextureEffect::Create(texture, | 362 GrSimpleTextureEffect::Create(texture, |
| 364 maskMatrix, | 363 maskMatrix, |
| 365 GrTextureParams::kNone_Fi
lterMode, | 364 GrTextureParams::kNone_Fi
lterMode, |
| 366 kDevice_GrCoordSet))->unr
ef(); | 365 kDevice_GrCoordSet))->unr
ef(); |
| 367 | 366 |
| 368 SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateNonAAFill(color, S
kMatrix::I(), | 367 SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateNonAAFill(color, S
kMatrix::I(), |
| 369 dstRect,
nullptr, &invert)); | 368 dstRect,
nullptr, &invert)); |
| 370 target->drawBatch(*pipelineBuilder, batch); | 369 target->drawBatch(*pipelineBuilder, batch); |
| 371 } | 370 } |
| OLD | NEW |