summaryrefslogtreecommitdiffstats
path: root/chromium/cc/layers/painted_overlay_scrollbar_layer_impl.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-07-12 14:07:37 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2017-07-17 10:29:26 +0000
commitec02ee4181c49b61fce1c8fb99292dbb8139cc90 (patch)
tree25cde714b2b71eb639d1cd53f5a22e9ba76e14ef /chromium/cc/layers/painted_overlay_scrollbar_layer_impl.cc
parentbb09965444b5bb20b096a291445170876225268d (diff)
BASELINE: Update Chromium to 59.0.3071.134
Change-Id: Id02ef6fb2204c5fd21668a1c3e6911c83b17585a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'chromium/cc/layers/painted_overlay_scrollbar_layer_impl.cc')
-rw-r--r--chromium/cc/layers/painted_overlay_scrollbar_layer_impl.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/chromium/cc/layers/painted_overlay_scrollbar_layer_impl.cc b/chromium/cc/layers/painted_overlay_scrollbar_layer_impl.cc
index c14b93be585..68cbfd45cd3 100644
--- a/chromium/cc/layers/painted_overlay_scrollbar_layer_impl.cc
+++ b/chromium/cc/layers/painted_overlay_scrollbar_layer_impl.cc
@@ -66,6 +66,9 @@ bool PaintedOverlayScrollbarLayerImpl::WillDraw(
void PaintedOverlayScrollbarLayerImpl::AppendQuads(
RenderPass* render_pass,
AppendQuadsData* append_quads_data) {
+ if (aperture_.IsEmpty())
+ return;
+
// For overlay scrollbars, the border should match the inset of the aperture
// and be symmetrical.
gfx::Rect border(aperture_.x(), aperture_.y(), aperture_.x() * 2,
@@ -75,6 +78,12 @@ void PaintedOverlayScrollbarLayerImpl::AppendQuads(
bool fill_center = true;
bool nearest_neighbor = false;
+ // Avoid drawing a scrollber in the degenerate case where the scroller is
+ // smaller than the border size.
+ if (thumb_quad_rect.height() < border.height() ||
+ thumb_quad_rect.width() < border.width())
+ return;
+
quad_generator_.SetLayout(image_bounds_, thumb_quad_rect.size(), aperture_,
border, layer_occlusion, fill_center,
nearest_neighbor);