Commit 29b1d414 authored by Florin Malita's avatar Florin Malita Committed by Commit Bot

Skip backgrounds when the computed tile size is empty

The computed background geometry tile size may end up empty due to
pixel-snapping.  In that case, all derived calculations are invalid and
we should not attempt to draw the background.

R=schenney@chromium.org
BUG=808065

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: If14ea82ca158318374296184a8f44856c19dcb64
Reviewed-on: https://chromium-review.googlesource.com/902148Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534545}
parent 73376524
<!DOCTYPE html>
<style>
div {
width: 100px;
height: 100px;
background-color: green;
}
</style>
<div></div>
<script>
if (window.testRunner)
eventSender.zoomPageOut();
</script>
<!DOCTYPE html>
<style>
div {
width: 100px;
height: 100px;
background-color: green;
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAABkCAYAAACsG+FjAAAAHklEQVQokWO8dv1mPwMDAwPLw4cPVzCMglEwCugMAFLqBmYwhLUeAAAAAElFTkSuQmCC');
background-size: 1px 50px;
}
</style>
<div></div>
<script>
if (window.testRunner)
eventSender.zoomPageOut();
</script>
...@@ -128,6 +128,9 @@ void Image::DrawTiledBackground(GraphicsContext& ctxt, ...@@ -128,6 +128,9 @@ void Image::DrawTiledBackground(GraphicsContext& ctxt,
const FloatSize& scaled_tile_size, const FloatSize& scaled_tile_size,
SkBlendMode op, SkBlendMode op,
const FloatSize& repeat_spacing) { const FloatSize& repeat_spacing) {
if (scaled_tile_size.IsEmpty())
return;
FloatSize intrinsic_tile_size(Size()); FloatSize intrinsic_tile_size(Size());
if (HasRelativeSize()) { if (HasRelativeSize()) {
intrinsic_tile_size.SetWidth(scaled_tile_size.Width()); intrinsic_tile_size.SetWidth(scaled_tile_size.Width());
......
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