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:
fmalita 2015-03-13 06:50:44 -07:00 committed by Commit bot
parent 11fa2247b7
commit 511005b2cc

View File

@ -160,8 +160,8 @@ SkShader* SkPictureShader::refBitmapShader(const SkMatrix& matrix, const SkMatri
SkSize scaledSize = SkSize::Make(SkScalarAbs(scale.x() * fTile.width()),
SkScalarAbs(scale.y() * fTile.height()));
// Clamp the tile size to about 16M pixels
static const SkScalar kMaxTileArea = 4096 * 4096;
// Clamp the tile size to about 4M pixels
static const SkScalar kMaxTileArea = 2048 * 2048;
SkScalar tileArea = SkScalarMul(scaledSize.width(), scaledSize.height());
if (tileArea > kMaxTileArea) {
SkScalar clampScale = SkScalarSqrt(SkScalarDiv(kMaxTileArea, tileArea));