void ScrollableAreaPainter::paintScrollCorner( GraphicsContext& context, const IntPoint& paintOffset, const CullRect& adjustedCullRect) { IntRect absRect = getScrollableArea().scrollCornerRect(); if (absRect.isEmpty()) return; absRect.moveBy(paintOffset); if (getScrollableArea().scrollCorner()) { if (!adjustedCullRect.intersectsCullRect(absRect)) return; ScrollbarPainter::paintIntoRect(*getScrollableArea().scrollCorner(), context, paintOffset, LayoutRect(absRect)); return; } // We don't want to paint white if we have overlay scrollbars, since we need // to see what is behind it. if (getScrollableArea().hasOverlayScrollbars()) return; if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible( context, getScrollableArea().box(), DisplayItem::kScrollbarCorner)) return; LayoutObjectDrawingRecorder recorder(context, getScrollableArea().box(), DisplayItem::kScrollbarCorner, absRect); context.fillRect(absRect, Color::white); }
void Scrollbar::paint(GraphicsContext* context, const CullRect& cullRect) const { if (!cullRect.intersectsCullRect(frameRect())) return; if (!theme()->paint(this, context, cullRect)) Widget::paint(context, cullRect); }
bool ScrollableAreaPainter::overflowControlsIntersectRect( const CullRect& cullRect) const { const IntRect borderBox = getScrollableArea().box().pixelSnappedBorderBoxRect(); if (cullRect.intersectsCullRect( getScrollableArea().rectForHorizontalScrollbar(borderBox))) return true; if (cullRect.intersectsCullRect( getScrollableArea().rectForVerticalScrollbar(borderBox))) return true; if (cullRect.intersectsCullRect(getScrollableArea().scrollCornerRect())) return true; if (cullRect.intersectsCullRect( getScrollableArea().resizerCornerRect(borderBox, ResizerForPointer))) return true; return false; }
void ScrollableAreaPainter::paintResizer(GraphicsContext& context, const IntPoint& paintOffset, const CullRect& cullRect) { if (getScrollableArea().box().style()->resize() == RESIZE_NONE) return; IntRect absRect = getScrollableArea().resizerCornerRect( getScrollableArea().box().pixelSnappedBorderBoxRect(), ResizerForPointer); if (absRect.isEmpty()) return; absRect.moveBy(paintOffset); if (getScrollableArea().resizer()) { if (!cullRect.intersectsCullRect(absRect)) return; ScrollbarPainter::paintIntoRect(*getScrollableArea().resizer(), context, paintOffset, LayoutRect(absRect)); return; } if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible( context, getScrollableArea().box(), DisplayItem::kResizer)) return; LayoutObjectDrawingRecorder recorder(context, getScrollableArea().box(), DisplayItem::kResizer, absRect); drawPlatformResizerImage(context, absRect); // Draw a frame around the resizer (1px grey line) if there are any scrollbars // present. Clipping will exclude the right and bottom edges of this frame. if (!getScrollableArea().hasOverlayScrollbars() && getScrollableArea().hasScrollbar()) { GraphicsContextStateSaver stateSaver(context); context.clip(absRect); IntRect largerCorner = absRect; largerCorner.setSize( IntSize(largerCorner.width() + 1, largerCorner.height() + 1)); context.setStrokeColor(Color(217, 217, 217)); context.setStrokeThickness(1.0f); context.setFillColor(Color::transparent); context.drawRect(largerCorner); } }