| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/paint/ScrollableAreaPainter.h" | 5 #include "core/paint/ScrollableAreaPainter.h" |
| 6 | 6 |
| 7 #include "core/layout/LayoutView.h" | 7 #include "core/layout/LayoutView.h" |
| 8 #include "core/page/Page.h" | 8 #include "core/page/Page.h" |
| 9 #include "core/paint/LayoutObjectDrawingRecorder.h" | 9 #include "core/paint/LayoutObjectDrawingRecorder.h" |
| 10 #include "core/paint/ObjectPaintProperties.h" | 10 #include "core/paint/ObjectPaintProperties.h" |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 if (objectProperties && objectProperties->scrollbarPaintOffset()) { | 166 if (objectProperties && objectProperties->scrollbarPaintOffset()) { |
| 167 PaintChunkProperties properties( | 167 PaintChunkProperties properties( |
| 168 context.getPaintController().currentPaintChunkProperties()); | 168 context.getPaintController().currentPaintChunkProperties()); |
| 169 properties.propertyTreeState.setTransform( | 169 properties.propertyTreeState.setTransform( |
| 170 objectProperties->scrollbarPaintOffset()); | 170 objectProperties->scrollbarPaintOffset()); |
| 171 scopedTransformProperty.emplace( | 171 scopedTransformProperty.emplace( |
| 172 context.getPaintController(), getScrollableArea().box(), | 172 context.getPaintController(), getScrollableArea().box(), |
| 173 DisplayItem::kScrollOverflowControls, properties); | 173 DisplayItem::kScrollOverflowControls, properties); |
| 174 } | 174 } |
| 175 } | 175 } |
| 176 if (getScrollableArea().horizontalScrollbar() && | 176 auto* hscrollbar = getScrollableArea().horizontalScrollbar(); |
| 177 !getScrollableArea().layerForHorizontalScrollbar()) { | 177 if (hscrollbar && !getScrollableArea().layerForHorizontalScrollbar()) { |
| 178 TransformRecorder translateRecorder( | 178 TransformRecorder translateRecorder( |
| 179 context, *getScrollableArea().horizontalScrollbar(), | 179 context, AffineTransform::translation(adjustedPaintOffset.x(), |
| 180 AffineTransform::translation(adjustedPaintOffset.x(), | 180 adjustedPaintOffset.y()), |
| 181 adjustedPaintOffset.y())); | 181 hscrollbar->visualRect(), hscrollbar->debugName(), |
| 182 hscrollbar->paintedOutputOfObjectHasNoEffectRegardlessOfSize()); |
| 182 getScrollableArea().horizontalScrollbar()->paint(context, | 183 getScrollableArea().horizontalScrollbar()->paint(context, |
| 183 adjustedCullRect); | 184 adjustedCullRect); |
| 184 } | 185 } |
| 185 if (getScrollableArea().verticalScrollbar() && | 186 auto* vscrollbar = getScrollableArea().verticalScrollbar(); |
| 186 !getScrollableArea().layerForVerticalScrollbar()) { | 187 if (vscrollbar && !getScrollableArea().layerForVerticalScrollbar()) { |
| 187 TransformRecorder translateRecorder( | 188 TransformRecorder translateRecorder( |
| 188 context, *getScrollableArea().verticalScrollbar(), | 189 context, AffineTransform::translation(adjustedPaintOffset.x(), |
| 189 AffineTransform::translation(adjustedPaintOffset.x(), | 190 adjustedPaintOffset.y()), |
| 190 adjustedPaintOffset.y())); | 191 vscrollbar->visualRect(), vscrollbar->debugName(), |
| 192 vscrollbar->paintedOutputOfObjectHasNoEffectRegardlessOfSize()); |
| 191 getScrollableArea().verticalScrollbar()->paint(context, adjustedCullRect); | 193 getScrollableArea().verticalScrollbar()->paint(context, adjustedCullRect); |
| 192 } | 194 } |
| 193 } | 195 } |
| 194 | 196 |
| 195 if (getScrollableArea().layerForScrollCorner()) | 197 if (getScrollableArea().layerForScrollCorner()) |
| 196 return; | 198 return; |
| 197 | 199 |
| 198 // We fill our scroll corner with white if we have a scrollbar that doesn't | 200 // We fill our scroll corner with white if we have a scrollbar that doesn't |
| 199 // run all the way up to the edge of the box. | 201 // run all the way up to the edge of the box. |
| 200 paintScrollCorner(context, adjustedPaintOffset, cullRect); | 202 paintScrollCorner(context, adjustedPaintOffset, cullRect); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 LayoutObjectDrawingRecorder recorder(context, getScrollableArea().box(), | 257 LayoutObjectDrawingRecorder recorder(context, getScrollableArea().box(), |
| 256 DisplayItem::kScrollbarCorner, absRect); | 258 DisplayItem::kScrollbarCorner, absRect); |
| 257 context.fillRect(absRect, Color::white); | 259 context.fillRect(absRect, Color::white); |
| 258 } | 260 } |
| 259 | 261 |
| 260 PaintLayerScrollableArea& ScrollableAreaPainter::getScrollableArea() const { | 262 PaintLayerScrollableArea& ScrollableAreaPainter::getScrollableArea() const { |
| 261 return *m_scrollableArea; | 263 return *m_scrollableArea; |
| 262 } | 264 } |
| 263 | 265 |
| 264 } // namespace blink | 266 } // namespace blink |
| OLD | NEW |