Lower SkPictureShader tile size limits
Let's drop this to 4M pixels - maybe it will help relieve DM pressure on mobile devices. R=reed@google.com,mtklein@google.com BUG=462348 Review URL: https://codereview.chromium.org/998423004
This commit is contained in:
parent
11fa2247b7
commit
511005b2cc
@ -160,8 +160,8 @@ SkShader* SkPictureShader::refBitmapShader(const SkMatrix& matrix, const SkMatri
|
|||||||
SkSize scaledSize = SkSize::Make(SkScalarAbs(scale.x() * fTile.width()),
|
SkSize scaledSize = SkSize::Make(SkScalarAbs(scale.x() * fTile.width()),
|
||||||
SkScalarAbs(scale.y() * fTile.height()));
|
SkScalarAbs(scale.y() * fTile.height()));
|
||||||
|
|
||||||
// Clamp the tile size to about 16M pixels
|
// Clamp the tile size to about 4M pixels
|
||||||
static const SkScalar kMaxTileArea = 4096 * 4096;
|
static const SkScalar kMaxTileArea = 2048 * 2048;
|
||||||
SkScalar tileArea = SkScalarMul(scaledSize.width(), scaledSize.height());
|
SkScalar tileArea = SkScalarMul(scaledSize.width(), scaledSize.height());
|
||||||
if (tileArea > kMaxTileArea) {
|
if (tileArea > kMaxTileArea) {
|
||||||
SkScalar clampScale = SkScalarSqrt(SkScalarDiv(kMaxTileArea, tileArea));
|
SkScalar clampScale = SkScalarSqrt(SkScalarDiv(kMaxTileArea, tileArea));
|
||||||
|
Loading…
Reference in New Issue
Block a user