SkPictureShader: floor scaledSize not to exceed maxTextureSize
scaledSize becomes larger than maxTextureSize by zoom level because it is rounded. BUG=chromium:485916 Review URL: https://codereview.chromium.org/1129413002
This commit is contained in:
parent
c19cdc254c
commit
88f12dbe92
@ -178,8 +178,8 @@ SkShader* SkPictureShader::refBitmapShader(const SkMatrix& matrix, const SkMatri
|
||||
if (scaledSize.width() > maxTextureSize || scaledSize.height() > maxTextureSize) {
|
||||
SkScalar downScale = SkScalarDiv(maxTextureSize,
|
||||
SkMax32(scaledSize.width(), scaledSize.height()));
|
||||
scaledSize.set(SkScalarMul(scaledSize.width(), downScale),
|
||||
SkScalarMul(scaledSize.height(), downScale));
|
||||
scaledSize.set(SkScalarFloorToScalar(SkScalarMul(scaledSize.width(), downScale)),
|
||||
SkScalarFloorToScalar(SkScalarMul(scaledSize.height(), downScale)));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user