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

Side by Side Diff: src/core/SkDraw.cpp

Issue 2125933003: check for zero scale in SkDraw::ComputeResScaleForStroking (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: 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 | no next file » | 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 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 #define __STDC_LIMIT_MACROS 7 #define __STDC_LIMIT_MACROS
8 8
9 #include "SkDraw.h" 9 #include "SkDraw.h"
10 #include "SkBlitter.h" 10 #include "SkBlitter.h"
(...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after
999 SkPath path; 999 SkPath path;
1000 path.addRRect(rrect); 1000 path.addRRect(rrect);
1001 this->drawPath(path, paint, nullptr, true); 1001 this->drawPath(path, paint, nullptr, true);
1002 } 1002 }
1003 1003
1004 SkScalar SkDraw::ComputeResScaleForStroking(const SkMatrix& matrix) { 1004 SkScalar SkDraw::ComputeResScaleForStroking(const SkMatrix& matrix) {
1005 if (!matrix.hasPerspective()) { 1005 if (!matrix.hasPerspective()) {
1006 SkScalar sx = SkPoint::Length(matrix[SkMatrix::kMScaleX], matrix[SkMatri x::kMSkewY]); 1006 SkScalar sx = SkPoint::Length(matrix[SkMatrix::kMScaleX], matrix[SkMatri x::kMSkewY]);
1007 SkScalar sy = SkPoint::Length(matrix[SkMatrix::kMSkewX], matrix[SkMatri x::kMScaleY]); 1007 SkScalar sy = SkPoint::Length(matrix[SkMatrix::kMSkewX], matrix[SkMatri x::kMScaleY]);
1008 if (SkScalarsAreFinite(sx, sy)) { 1008 if (SkScalarsAreFinite(sx, sy)) {
1009 return SkTMax(sx, sy); 1009 SkScalar scale = SkTMax(sx, sy);
1010 if (scale > 0) {
1011 return scale;
1012 }
1010 } 1013 }
1011 } 1014 }
1012 return 1; 1015 return 1;
1013 } 1016 }
1014 1017
1015 void SkDraw::drawDevPath(const SkPath& devPath, const SkPaint& paint, bool drawC overage, 1018 void SkDraw::drawDevPath(const SkPath& devPath, const SkPaint& paint, bool drawC overage,
1016 SkBlitter* customBlitter, bool doFill) const { 1019 SkBlitter* customBlitter, bool doFill) const {
1017 SkBlitter* blitter = nullptr; 1020 SkBlitter* blitter = nullptr;
1018 SkAutoBlitterChoose blitterStorage; 1021 SkAutoBlitterChoose blitterStorage;
1019 if (nullptr == customBlitter) { 1022 if (nullptr == customBlitter) {
(...skipping 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after
2081 mask->fImage = SkMask::AllocImage(size); 2084 mask->fImage = SkMask::AllocImage(size);
2082 memset(mask->fImage, 0, mask->computeImageSize()); 2085 memset(mask->fImage, 0, mask->computeImageSize());
2083 } 2086 }
2084 2087
2085 if (SkMask::kJustComputeBounds_CreateMode != mode) { 2088 if (SkMask::kJustComputeBounds_CreateMode != mode) {
2086 draw_into_mask(*mask, devPath, style); 2089 draw_into_mask(*mask, devPath, style);
2087 } 2090 }
2088 2091
2089 return true; 2092 return true;
2090 } 2093 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698