Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Side by Side Diff: sky/engine/core/rendering/RenderBox.cpp

Issue 712573003: Remove usesCompositedScrolling (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: moar Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/engine/core/rendering/RenderBox.h ('k') | sky/engine/core/rendering/RenderLayer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 if (!hasOverflowClip()) 467 if (!hasOverflowClip())
468 return false; 468 return false;
469 469
470 bool hasScrollableOverflow = hasScrollableOverflowX() || hasScrollableOverfl owY(); 470 bool hasScrollableOverflow = hasScrollableOverflowX() || hasScrollableOverfl owY();
471 if (scrollsOverflow() && hasScrollableOverflow) 471 if (scrollsOverflow() && hasScrollableOverflow)
472 return true; 472 return true;
473 473
474 return node && node->hasEditableStyle(); 474 return node && node->hasEditableStyle();
475 } 475 }
476 476
477 bool RenderBox::usesCompositedScrolling() const
478 {
479 return hasOverflowClip() && hasLayer() && layer()->scrollableArea()->usesCom positedScrolling();
480 }
481
482 void RenderBox::autoscroll(const IntPoint& position) 477 void RenderBox::autoscroll(const IntPoint& position)
483 { 478 {
484 LocalFrame* frame = this->frame(); 479 LocalFrame* frame = this->frame();
485 if (!frame) 480 if (!frame)
486 return; 481 return;
487 482
488 FrameView* frameView = frame->view(); 483 FrameView* frameView = frame->view();
489 if (!frameView) 484 if (!frameView)
490 return; 485 return;
491 486
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 return layer()->scrollableArea()->scrollOffset(); 575 return layer()->scrollableArea()->scrollOffset();
581 } 576 }
582 577
583 void RenderBox::applyCachedClipAndScrollOffsetForPaintInvalidation(LayoutRect& p aintRect) const 578 void RenderBox::applyCachedClipAndScrollOffsetForPaintInvalidation(LayoutRect& p aintRect) const
584 { 579 {
585 ASSERT(hasLayer()); 580 ASSERT(hasLayer());
586 ASSERT(hasOverflowClip()); 581 ASSERT(hasOverflowClip());
587 582
588 paintRect.move(-scrolledContentOffset()); // For overflow:auto/scroll/hidden . 583 paintRect.move(-scrolledContentOffset()); // For overflow:auto/scroll/hidden .
589 584
590 // Do not clip scroll layer contents to reduce the number of paint invalidat ions while scrolling.
591 if (usesCompositedScrolling())
592 return;
593
594 // height() is inaccurate if we're in the middle of a layout of this RenderB ox, so use the 585 // height() is inaccurate if we're in the middle of a layout of this RenderB ox, so use the
595 // layer's size instead. Even if the layer's size is wrong, the layer itself will issue paint invalidations 586 // layer's size instead. Even if the layer's size is wrong, the layer itself will issue paint invalidations
596 // anyway if its size does change. 587 // anyway if its size does change.
597 LayoutRect clipRect(LayoutPoint(), layer()->size()); 588 LayoutRect clipRect(LayoutPoint(), layer()->size());
598 paintRect = intersection(paintRect, clipRect); 589 paintRect = intersection(paintRect, clipRect);
599 } 590 }
600 591
601 void RenderBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, Layou tUnit& maxLogicalWidth) const 592 void RenderBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, Layou tUnit& maxLogicalWidth) const
602 { 593 {
603 minLogicalWidth = minPreferredLogicalWidth() - borderAndPaddingLogicalWidth( ); 594 minLogicalWidth = minPreferredLogicalWidth() - borderAndPaddingLogicalWidth( );
(...skipping 3110 matching lines...) Expand 10 before | Expand all | Expand 10 after
3714 // FIXME: when the above mentioned bug is fixed, it should hopefully be poss ible to call 3705 // FIXME: when the above mentioned bug is fixed, it should hopefully be poss ible to call
3715 // clientBoxRect() or paddingBoxRect() in this method, rather than fiddling with the edges on 3706 // clientBoxRect() or paddingBoxRect() in this method, rather than fiddling with the edges on
3716 // our own. 3707 // our own.
3717 if (style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) 3708 if (style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
3718 rect.contract(0, scrollBarHeight); 3709 rect.contract(0, scrollBarHeight);
3719 else 3710 else
3720 rect.contract(scrollBarWidth, scrollBarHeight); 3711 rect.contract(scrollBarWidth, scrollBarHeight);
3721 return rect; 3712 return rect;
3722 } 3713 }
3723 3714
3724 LayoutRect RenderBox::overflowRectForPaintRejection() const
3725 {
3726 LayoutRect overflowRect = visualOverflowRect();
3727 if (!m_overflow || !usesCompositedScrolling())
3728 return overflowRect;
3729
3730 overflowRect.unite(layoutOverflowRect());
3731 overflowRect.move(-scrolledContentOffset());
3732 return overflowRect;
3733 }
3734
3735 LayoutUnit RenderBox::offsetLeft() const 3715 LayoutUnit RenderBox::offsetLeft() const
3736 { 3716 {
3737 return adjustedPositionRelativeToOffsetParent(topLeftLocation()).x(); 3717 return adjustedPositionRelativeToOffsetParent(topLeftLocation()).x();
3738 } 3718 }
3739 3719
3740 LayoutUnit RenderBox::offsetTop() const 3720 LayoutUnit RenderBox::offsetTop() const
3741 { 3721 {
3742 return adjustedPositionRelativeToOffsetParent(topLeftLocation()).y(); 3722 return adjustedPositionRelativeToOffsetParent(topLeftLocation()).y();
3743 } 3723 }
3744 3724
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
3840 3820
3841 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) 3821 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style)
3842 { 3822 {
3843 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor); 3823 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor);
3844 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); 3824 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage();
3845 ASSERT(hasBackground == style.hasBackground()); 3825 ASSERT(hasBackground == style.hasBackground());
3846 hasBorder = style.hasBorder(); 3826 hasBorder = style.hasBorder();
3847 } 3827 }
3848 3828
3849 } // namespace blink 3829 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderBox.h ('k') | sky/engine/core/rendering/RenderLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698