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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 1391753005: (WIP) Invalidation during painting (for synchronized painting) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months 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
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 1897 matching lines...) Expand 10 before | Expand all | Expand 10 after
1908 // physical coordinate space of the paintInvalidationContainer. 1908 // physical coordinate space of the paintInvalidationContainer.
1909 const ComputedStyle& styleToUse = styleRef(); 1909 const ComputedStyle& styleToUse = styleRef();
1910 1910
1911 EPosition position = styleToUse.position(); 1911 EPosition position = styleToUse.position();
1912 1912
1913 // We need to inflate the paint invalidation rect before we use paintInvalid ationState, 1913 // We need to inflate the paint invalidation rect before we use paintInvalid ationState,
1914 // else we would forget to inflate it for the current layoutObject. FIXME: I f these were 1914 // else we would forget to inflate it for the current layoutObject. FIXME: I f these were
1915 // included into the visual overflow for repaint, we wouldn't have this issu e. 1915 // included into the visual overflow for repaint, we wouldn't have this issu e.
1916 inflatePaintInvalidationRectForReflectionAndFilter(rect); 1916 inflatePaintInvalidationRectForReflectionAndFilter(rect);
1917 1917
1918 if (paintInvalidationState && paintInvalidationState->canMapToContainer(ance stor) && position != FixedPosition) { 1918 if (paintInvalidationState && paintInvalidationState->canMapToContainer(ance stor)
1919 // We support fast path mapping to container for fixed-position in SPv2.
1920 && (position != FixedPosition || RuntimeEnabledFeatures::slimmingPaintV2 Enabled())) {
1919 if (layer() && layer()->transform()) 1921 if (layer() && layer()->transform())
1920 rect = LayoutRect(layer()->transform()->mapRect(pixelSnappedIntRect( rect))); 1922 rect = LayoutRect(layer()->transform()->mapRect(pixelSnappedIntRect( rect)));
1921 1923
1922 // We can't trust the bits on LayoutObject, because this might be called while re-resolving style. 1924 // We can't trust the bits on LayoutObject, because this might be called while re-resolving style.
1923 if (styleToUse.hasInFlowPosition() && layer()) 1925 if (styleToUse.hasInFlowPosition() && layer())
1924 rect.move(layer()->offsetForInFlowPosition()); 1926 rect.move(layer()->offsetForInFlowPosition());
1925 1927
1926 rect.moveBy(location()); 1928 rect.moveBy(location());
1927 rect.move(paintInvalidationState->paintOffset()); 1929 rect.move(paintInvalidationState->paintOffset());
1928 if (paintInvalidationState->isClipped()) 1930 if (paintInvalidationState->isClipped())
(...skipping 1891 matching lines...) Expand 10 before | Expand all | Expand 10 after
3820 return PaintInvalidationLayoutOverflowBoxChange; 3822 return PaintInvalidationLayoutOverflowBoxChange;
3821 } 3823 }
3822 3824
3823 LayoutSize oldBorderBoxSize = computePreviousBorderBoxSize(oldBounds.size()) ; 3825 LayoutSize oldBorderBoxSize = computePreviousBorderBoxSize(oldBounds.size()) ;
3824 LayoutSize newBorderBoxSize = size(); 3826 LayoutSize newBorderBoxSize = size();
3825 3827
3826 if (oldBorderBoxSize == newBorderBoxSize) 3828 if (oldBorderBoxSize == newBorderBoxSize)
3827 return invalidationReason; 3829 return invalidationReason;
3828 3830
3829 // LayoutBox::incrementallyInvalidatePaint() depends on positionFromPaintInv alidationBacking 3831 // LayoutBox::incrementallyInvalidatePaint() depends on positionFromPaintInv alidationBacking
3830 // which is not available when slimmingPaintOffsetCachingEnabled. 3832 // which is not available in SPv2.
3831 if (RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled() && (style()- >hasBoxDecorations() || style()->hasBackground())) 3833 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && (style()->hasBoxDeco rations() || (style()->hasBackground() && hasVisualOverflow())))
3832 return PaintInvalidationBorderBoxChange; 3834 return PaintInvalidationBorderBoxChange;
3833 3835
3834 // TODO(wangxianzhu): Remove incremental invalidation when we remove rect-ba sed paint invalidation. 3836 // TODO(wangxianzhu): Remove incremental invalidation when we remove rect-ba sed paint invalidation.
3835 // See another hasNonCompositedScrollbars() callsite above. 3837 // See another hasNonCompositedScrollbars() callsite above.
3836 if (hasNonCompositedScrollbars()) 3838 if (hasNonCompositedScrollbars())
3837 return PaintInvalidationBorderBoxChange; 3839 return PaintInvalidationBorderBoxChange;
3838 3840
3839 if (style()->hasVisualOverflowingEffect() || style()->hasAppearance() || sty le()->hasFilter() || style()->resize() != RESIZE_NONE) 3841 if (style()->hasVisualOverflowingEffect() || style()->hasAppearance() || sty le()->hasFilter() || style()->resize() != RESIZE_NONE)
3840 return PaintInvalidationBorderBoxChange; 3842 return PaintInvalidationBorderBoxChange;
3841 3843
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after
4682 } 4684 }
4683 4685
4684 void LayoutBox::IntrinsicSizingInfo::transpose() 4686 void LayoutBox::IntrinsicSizingInfo::transpose()
4685 { 4687 {
4686 size = size.transposedSize(); 4688 size = size.transposedSize();
4687 aspectRatio = aspectRatio.transposedSize(); 4689 aspectRatio = aspectRatio.transposedSize();
4688 std::swap(hasWidth, hasHeight); 4690 std::swap(hasWidth, hasHeight);
4689 } 4691 }
4690 4692
4691 } // namespace blink 4693 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698