Commit 8c978056 authored by xidachen's avatar xidachen Committed by Commit bot

Change an existing check to ASSERT

In ImageBitmap, the static function frameIsValid() includes a check that
is changed to ASSERT in this CL. In the meantime, this CL also removes a
redundant ASSERT.

Review URL: https://codereview.chromium.org/1683983002

Cr-Commit-Position: refs/heads/master@{#374704}
parent 0c7e2f7b
......@@ -43,9 +43,8 @@ static inline IntRect normalizeRect(const IntRect& rect)
static bool frameIsValid(const SkBitmap& frameBitmap)
{
ASSERT(!frameBitmap.isNull() && !frameBitmap.empty());
return frameBitmap.isImmutable()
&& frameBitmap.colorType() == kN32_SkColorType;
ASSERT(!frameBitmap.isNull() && !frameBitmap.empty() && frameBitmap.isImmutable());
return frameBitmap.colorType() == kN32_SkColorType;
}
static SkImage* flipSkImageVertically(SkImage* input)
......@@ -104,7 +103,6 @@ static PassRefPtr<StaticBitmapImage> cropImage(Image* image, const IntRect& crop
SkBitmap bitmap = frame->bitmap();
if (!frameIsValid(bitmap))
return nullptr;
ASSERT(bitmap.isImmutable());
skiaImage = adoptRef(SkImage::NewFromBitmap(bitmap));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment