зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1305085 - don't let SkScalerContext::computeMatrices generate zero scales. r=mchang
MozReview-Commit-ID: 4guj6XPWB47
This commit is contained in:
Родитель
e4cbb5aad8
Коммит
29a9c9d166
|
@ -0,0 +1,9 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<script>
|
||||
var c = document.createElementNS('http://www.w3.org/1999/xhtml', 'canvas');
|
||||
var cx = c.getContext('2d');
|
||||
cx.setTransform(1, 2, 2, 4, 0.41577222277777554, 0.89);
|
||||
cx.fillText("AA",2048,4);
|
||||
</script>
|
||||
</html>
|
|
@ -38,6 +38,7 @@ load 1290628-1.html
|
|||
load 1283113-1.html
|
||||
load 1286458-1.html
|
||||
load 1299062-1.html
|
||||
load 1305085-1.html
|
||||
load 1305312-1.html
|
||||
load 1298576-1.html
|
||||
load 1334366-1.html
|
||||
|
|
|
@ -760,12 +760,24 @@ bool SkScalerContextRec::computeMatrices(PreMatrixScale preMatrixScale, SkVector
|
|||
|
||||
// At this point, given GA, create s.
|
||||
switch (preMatrixScale) {
|
||||
case kFull_PreMatrixScale:
|
||||
s->fX = SkScalarAbs(GA.get(SkMatrix::kMScaleX));
|
||||
s->fY = SkScalarAbs(GA.get(SkMatrix::kMScaleY));
|
||||
case kFull_PreMatrixScale: {
|
||||
SkScalar xScale = SkScalarAbs(GA.get(SkMatrix::kMScaleX));
|
||||
SkScalar yScale = SkScalarAbs(GA.get(SkMatrix::kMScaleY));
|
||||
if (xScale <= SK_ScalarNearlyZero) {
|
||||
xScale = SK_Scalar1;
|
||||
}
|
||||
if (yScale <= SK_ScalarNearlyZero) {
|
||||
yScale = SK_Scalar1;
|
||||
}
|
||||
s->fX = xScale;
|
||||
s->fY = yScale;
|
||||
break;
|
||||
}
|
||||
case kVertical_PreMatrixScale: {
|
||||
SkScalar yScale = SkScalarAbs(GA.get(SkMatrix::kMScaleY));
|
||||
if (yScale <= SK_ScalarNearlyZero) {
|
||||
yScale = SK_Scalar1;
|
||||
}
|
||||
s->fX = yScale;
|
||||
s->fY = yScale;
|
||||
break;
|
||||
|
|
Загрузка…
Ссылка в новой задаче