| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/PaintPropertyTreeBuilder.h" | 5 #include "core/paint/PaintPropertyTreeBuilder.h" |
| 6 | 6 |
| 7 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
| 8 #include "core/frame/LocalFrame.h" | 8 #include "core/frame/LocalFrame.h" |
| 9 #include "core/frame/Settings.h" | 9 #include "core/frame/Settings.h" |
| 10 #include "core/layout/LayoutInline.h" | 10 #include "core/layout/LayoutInline.h" |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 } | 431 } |
| 432 | 432 |
| 433 context.current.transform = object.getMutableForPainting().ensureObjectPaint
Properties().createOrUpdateSvgLocalToBorderBoxTransform( | 433 context.current.transform = object.getMutableForPainting().ensureObjectPaint
Properties().createOrUpdateSvgLocalToBorderBoxTransform( |
| 434 context.current.transform, transformToBorderBox, FloatPoint3D()); | 434 context.current.transform, transformToBorderBox, FloatPoint3D()); |
| 435 context.current.shouldFlattenInheritedTransform = false; | 435 context.current.shouldFlattenInheritedTransform = false; |
| 436 context.current.renderingContextID = 0; | 436 context.current.renderingContextID = 0; |
| 437 } | 437 } |
| 438 | 438 |
| 439 void PaintPropertyTreeBuilder::updateScrollAndScrollTranslation(const LayoutObje
ct& object, PaintPropertyTreeBuilderContext& context) | 439 void PaintPropertyTreeBuilder::updateScrollAndScrollTranslation(const LayoutObje
ct& object, PaintPropertyTreeBuilderContext& context) |
| 440 { | 440 { |
| 441 if (object.isBoxModelObject() && object.hasOverflowClip()) { | 441 if (object.hasOverflowClip()) { |
| 442 PaintLayer* layer = toLayoutBoxModelObject(object).layer(); | 442 const LayoutBox& box = toLayoutBox(object); |
| 443 DCHECK(layer); | 443 const PaintLayerScrollableArea* scrollableArea = box.getScrollableArea()
; |
| 444 DoubleSize scrollOffset = layer->getScrollableArea()->scrollOffset(); | 444 DoubleSize scrollOffset = box.scrolledContentOffset(); |
| 445 if (!scrollOffset.isZero() || layer->scrollsOverflow()) { | 445 if (!scrollOffset.isZero() || scrollableArea->scrollsOverflow()) { |
| 446 TransformationMatrix matrix = TransformationMatrix().translate(-scro
llOffset.width(), -scrollOffset.height()); | 446 TransformationMatrix matrix = TransformationMatrix().translate(-scro
llOffset.width(), -scrollOffset.height()); |
| 447 context.current.transform = object.getMutableForPainting().ensureObj
ectPaintProperties().createOrUpdateScrollTranslation( | 447 context.current.transform = object.getMutableForPainting().ensureObj
ectPaintProperties().createOrUpdateScrollTranslation( |
| 448 context.current.transform, matrix, FloatPoint3D(), context.curre
nt.shouldFlattenInheritedTransform, context.current.renderingContextID); | 448 context.current.transform, matrix, FloatPoint3D(), context.curre
nt.shouldFlattenInheritedTransform, context.current.renderingContextID); |
| 449 | 449 |
| 450 IntSize scrollClip = layer->getScrollableArea()->visibleContentRect(
).size(); | 450 IntSize scrollClip = scrollableArea->visibleContentRect().size(); |
| 451 IntSize scrollBounds = layer->getScrollableArea()->contentsSize(); | 451 IntSize scrollBounds = scrollableArea->contentsSize(); |
| 452 bool userScrollableHorizontal = layer->getScrollableArea()->userInpu
tScrollable(HorizontalScrollbar); | 452 bool userScrollableHorizontal = scrollableArea->userInputScrollable(
HorizontalScrollbar); |
| 453 bool userScrollableVertical = layer->getScrollableArea()->userInputS
crollable(VerticalScrollbar); | 453 bool userScrollableVertical = scrollableArea->userInputScrollable(Ve
rticalScrollbar); |
| 454 context.current.scroll = object.getMutableForPainting().ensureObject
PaintProperties().createOrUpdateScroll( | 454 context.current.scroll = object.getMutableForPainting().ensureObject
PaintProperties().createOrUpdateScroll( |
| 455 context.current.scroll, context.current.transform, scrollClip, s
crollBounds, userScrollableHorizontal, userScrollableVertical); | 455 context.current.scroll, context.current.transform, scrollClip, s
crollBounds, userScrollableHorizontal, userScrollableVertical); |
| 456 | 456 |
| 457 context.current.shouldFlattenInheritedTransform = false; | 457 context.current.shouldFlattenInheritedTransform = false; |
| 458 return; | 458 return; |
| 459 } | 459 } |
| 460 } | 460 } |
| 461 | 461 |
| 462 if (ObjectPaintProperties* properties = object.getMutableForPainting().objec
tPaintProperties()) { | 462 if (ObjectPaintProperties* properties = object.getMutableForPainting().objec
tPaintProperties()) { |
| 463 properties->clearScrollTranslation(); | 463 properties->clearScrollTranslation(); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 return; | 579 return; |
| 580 | 580 |
| 581 updateOverflowClip(object, context); | 581 updateOverflowClip(object, context); |
| 582 updatePerspective(object, context); | 582 updatePerspective(object, context); |
| 583 updateSvgLocalToBorderBoxTransform(object, context); | 583 updateSvgLocalToBorderBoxTransform(object, context); |
| 584 updateScrollAndScrollTranslation(object, context); | 584 updateScrollAndScrollTranslation(object, context); |
| 585 updateOutOfFlowContext(object, context); | 585 updateOutOfFlowContext(object, context); |
| 586 } | 586 } |
| 587 | 587 |
| 588 } // namespace blink | 588 } // namespace blink |
| OLD | NEW |