Commit 46c0ec38 authored by jdduke's avatar jdduke Committed by Commit bot

[Android] Clear backing SkBitmap before rendering the overscroll effect

Skia makes no guarantees about the contents of a newly allocated
SkBitmap. Consequently, it's possible that the bitmap allocated for the
overscroll effect isn't zeroed before the effect itself is painted.
Prevent related issues by always clearing the allocated SkBitmap's
contents (to fully transparent) before painting the effect.

BUG=408225

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

Cr-Commit-Position: refs/heads/master@{#292280}
parent caf34058
...@@ -45,6 +45,7 @@ SkBitmap CreateOverscrollGlowLBitmap(const gfx::Size& screen_size) { ...@@ -45,6 +45,7 @@ SkBitmap CreateOverscrollGlowLBitmap(const gfx::Size& screen_size) {
LOG(FATAL) << " Failed to allocate bitmap of size " << bounds.width() << "x" LOG(FATAL) << " Failed to allocate bitmap of size " << bounds.width() << "x"
<< bounds.height(); << bounds.height();
} }
glow_bitmap.eraseColor(SK_ColorTRANSPARENT);
SkCanvas canvas(glow_bitmap); SkCanvas canvas(glow_bitmap);
canvas.clipRect(SkRect::MakeXYWH(0, 0, bounds.width(), bounds.height())); canvas.clipRect(SkRect::MakeXYWH(0, 0, bounds.width(), bounds.height()));
......
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