Commit 07c179d9 authored by Mike Klein's avatar Mike Klein Committed by Commit Bot

don't write non-opaque pixels to an 'opaque' bitmap

Writing non-opaque pixels to a bitmap tagged opaque breaks the contract
for tagging bitmaps opaque, and can lead to nonsense later inside Skia.

Change-Id: I60abf381f091a3699939f4327c7029555bc9ce39
Reviewed-on: https://chromium-review.googlesource.com/1231053Reviewed-by: default avatarEmircan Uysaler <emircan@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Cr-Commit-Position: refs/heads/master@{#592070}
parent 545d0bf4
......@@ -83,7 +83,7 @@ class CanvasCaptureHandlerTest
static sk_sp<SkImage> GenerateTestImage(bool opaque, int width, int height) {
SkBitmap testBitmap;
testBitmap.allocN32Pixels(width, height, opaque);
testBitmap.eraseARGB(kTestAlphaValue, 30, 60, 200);
testBitmap.eraseARGB(opaque ? 255 : kTestAlphaValue, 30, 60, 200);
return SkImage::MakeFromBitmap(testBitmap);
}
......
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