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

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

Issue 850763008: Remove assorted dead paint invalidation code. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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
« 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 3071 matching lines...) Expand 10 before | Expand all | Expand 10 after
3082 return adjustedPositionRelativeToOffsetParent(location()).y(); 3082 return adjustedPositionRelativeToOffsetParent(location()).y();
3083 } 3083 }
3084 3084
3085 bool RenderBox::hasRelativeLogicalHeight() const 3085 bool RenderBox::hasRelativeLogicalHeight() const
3086 { 3086 {
3087 return style()->logicalHeight().isPercent() 3087 return style()->logicalHeight().isPercent()
3088 || style()->logicalMinHeight().isPercent() 3088 || style()->logicalMinHeight().isPercent()
3089 || style()->logicalMaxHeight().isPercent(); 3089 || style()->logicalMaxHeight().isPercent();
3090 } 3090 }
3091 3091
3092 void RenderBox::savePreviousBorderBoxSizeIfNeeded()
3093 {
3094 // If m_rareData is already created, always save.
3095 if (!m_rareData) {
3096 LayoutSize paintInvalidationSize = previousPaintInvalidationRect().size( );
3097
3098 // Don't save old border box size if the paint rect is empty because we' ll
3099 // full invalidate once the paint rect becomes non-empty.
3100 if (paintInvalidationSize.isEmpty())
3101 return;
3102
3103 // Don't save old border box size if we can use size of the old paint re ct
3104 // as the old border box size in the next invalidation.
3105 if (paintInvalidationSize == size())
3106 return;
3107
3108 // We need the old border box size only when the box has background or b ox decorations.
3109 if (!style()->hasBackground() && !style()->hasBoxDecorations())
3110 return;
3111 }
3112
3113 ensureRareData().m_previousBorderBoxSize = size();
3114 }
3115
3116 LayoutSize RenderBox::computePreviousBorderBoxSize(const LayoutSize& previousBou ndsSize) const
3117 {
3118 // PreviousBorderBoxSize is only valid when there is background or box decor ations.
3119 ASSERT(style()->hasBackground() || style()->hasBoxDecorations());
3120
3121 if (m_rareData && m_rareData->m_previousBorderBoxSize.width() != -1)
3122 return m_rareData->m_previousBorderBoxSize;
3123
3124 // We didn't save the old border box size because it was the same as the siz e of oldBounds.
3125 return previousBoundsSize;
3126 }
3127
3128 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) 3092 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style)
3129 { 3093 {
3130 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor); 3094 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor);
3131 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); 3095 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage();
3132 ASSERT(hasBackground == style.hasBackground()); 3096 ASSERT(hasBackground == style.hasBackground());
3133 hasBorder = style.hasBorder(); 3097 hasBorder = style.hasBorder();
3134 } 3098 }
3135 3099
3136 } // namespace blink 3100 } // 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