| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 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 "SkDraw.h" | 8 #include "SkDraw.h" |
| 9 #include "SkBlitter.h" | 9 #include "SkBlitter.h" |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 SkScalar width = paint.getStrokeWidth(); | 453 SkScalar width = paint.getStrokeWidth(); |
| 454 if (0 == width) { | 454 if (0 == width) { |
| 455 fMode = mode; | 455 fMode = mode; |
| 456 fPaint = &paint; | 456 fPaint = &paint; |
| 457 fClip = NULL; | 457 fClip = NULL; |
| 458 fRC = rc; | 458 fRC = rc; |
| 459 fRadius = SK_FixedHalf; | 459 fRadius = SK_FixedHalf; |
| 460 return true; | 460 return true; |
| 461 } | 461 } |
| 462 if (paint.getStrokeCap() != SkPaint::kRound_Cap && | 462 if (paint.getStrokeCap() != SkPaint::kRound_Cap && |
| 463 matrix->rectStaysRect() && SkCanvas::kPoints_PointMode == mode) { | 463 matrix->isScaleTranslate() && SkCanvas::kPoints_PointMode == mode) { |
| 464 SkScalar sx = matrix->get(SkMatrix::kMScaleX); | 464 SkScalar sx = matrix->get(SkMatrix::kMScaleX); |
| 465 SkScalar sy = matrix->get(SkMatrix::kMScaleY); | 465 SkScalar sy = matrix->get(SkMatrix::kMScaleY); |
| 466 if (SkScalarNearlyZero(sx - sy)) { | 466 if (SkScalarNearlyZero(sx - sy)) { |
| 467 if (sx < 0) { | 467 if (sx < 0) { |
| 468 sx = -sx; | 468 sx = -sx; |
| 469 } | 469 } |
| 470 | 470 |
| 471 fMode = mode; | 471 fMode = mode; |
| 472 fPaint = &paint; | 472 fPaint = &paint; |
| 473 fClip = NULL; | 473 fClip = NULL; |
| (...skipping 1904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2378 mask->fImage = SkMask::AllocImage(size); | 2378 mask->fImage = SkMask::AllocImage(size); |
| 2379 memset(mask->fImage, 0, mask->computeImageSize()); | 2379 memset(mask->fImage, 0, mask->computeImageSize()); |
| 2380 } | 2380 } |
| 2381 | 2381 |
| 2382 if (SkMask::kJustComputeBounds_CreateMode != mode) { | 2382 if (SkMask::kJustComputeBounds_CreateMode != mode) { |
| 2383 draw_into_mask(*mask, devPath, style); | 2383 draw_into_mask(*mask, devPath, style); |
| 2384 } | 2384 } |
| 2385 | 2385 |
| 2386 return true; | 2386 return true; |
| 2387 } | 2387 } |
| OLD | NEW |