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

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

Issue 844023003: Delete InvalidationReason. (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/RenderObject.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 2978 matching lines...) Expand 10 before | Expand all | Expand 10 after
2989 closestRenderer = renderer; 2989 closestRenderer = renderer;
2990 minDist = dist; 2990 minDist = dist;
2991 } 2991 }
2992 } 2992 }
2993 2993
2994 if (closestRenderer) 2994 if (closestRenderer)
2995 return closestRenderer->positionForPoint(adjustedPoint - closestRenderer ->locationOffset()); 2995 return closestRenderer->positionForPoint(adjustedPoint - closestRenderer ->locationOffset());
2996 return createPositionWithAffinity(firstPositionInOrBeforeNode(node())); 2996 return createPositionWithAffinity(firstPositionInOrBeforeNode(node()));
2997 } 2997 }
2998 2998
2999 InvalidationReason RenderBox::getPaintInvalidationReason(const RenderLayerModelO bject& paintInvalidationContainer,
3000 const LayoutRect& oldBounds, const LayoutPoint& oldLocation, const LayoutRec t& newBounds, const LayoutPoint& newLocation)
3001 {
3002 InvalidationReason invalidationReason = RenderBoxModelObject::getPaintInvali dationReason(paintInvalidationContainer, oldBounds, oldLocation, newBounds, newL ocation);
3003 if (invalidationReason != InvalidationNone && invalidationReason != Invalida tionIncremental)
3004 return invalidationReason;
3005
3006 if (!style()->hasBackground() && !style()->hasBoxDecorations())
3007 return invalidationReason;
3008
3009 LayoutSize oldBorderBoxSize = computePreviousBorderBoxSize(oldBounds.size()) ;
3010 LayoutSize newBorderBoxSize = size();
3011
3012 if (oldBorderBoxSize == newBorderBoxSize)
3013 return invalidationReason;
3014
3015 // FIXME: Implement correct incremental invalidation for visual overflowing effects.
3016 if (style()->hasVisualOverflowingEffect() || style()->hasFilter())
3017 return InvalidationBorderBoxChange;
3018
3019 if (style()->hasBorderRadius()) {
3020 // If a border-radius exists and width/height is smaller than radius wid th/height,
3021 // we need to fully invalidate to cover the changed radius.
3022 RoundedRect oldRoundedRect = style()->getRoundedBorderFor(LayoutRect(Lay outPoint(0, 0), oldBorderBoxSize));
3023 RoundedRect newRoundedRect = style()->getRoundedBorderFor(LayoutRect(Lay outPoint(0, 0), newBorderBoxSize));
3024 if (oldRoundedRect.radii() != newRoundedRect.radii())
3025 return InvalidationBorderBoxChange;
3026 }
3027
3028 if (oldBorderBoxSize.width() != newBorderBoxSize.width() && mustInvalidateBa ckgroundOrBorderPaintOnWidthChange())
3029 return InvalidationBorderBoxChange;
3030 if (oldBorderBoxSize.height() != newBorderBoxSize.height() && mustInvalidate BackgroundOrBorderPaintOnHeightChange())
3031 return InvalidationBorderBoxChange;
3032
3033 return InvalidationIncremental;
3034 }
3035
3036 void RenderBox::addVisualEffectOverflow() 2999 void RenderBox::addVisualEffectOverflow()
3037 { 3000 {
3038 if (!style()->hasVisualOverflowingEffect()) 3001 if (!style()->hasVisualOverflowingEffect())
3039 return; 3002 return;
3040 3003
3041 // Add in the final overflow with shadows, outsets and outline combined. 3004 // Add in the final overflow with shadows, outsets and outline combined.
3042 LayoutRect visualEffectOverflow = borderBoxRect(); 3005 LayoutRect visualEffectOverflow = borderBoxRect();
3043 visualEffectOverflow.expand(computeVisualEffectOverflowExtent()); 3006 visualEffectOverflow.expand(computeVisualEffectOverflowExtent());
3044 addVisualOverflow(visualEffectOverflow); 3007 addVisualOverflow(visualEffectOverflow);
3045 } 3008 }
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
3338 3301
3339 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) 3302 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style)
3340 { 3303 {
3341 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor); 3304 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor);
3342 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); 3305 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage();
3343 ASSERT(hasBackground == style.hasBackground()); 3306 ASSERT(hasBackground == style.hasBackground());
3344 hasBorder = style.hasBorder(); 3307 hasBorder = style.hasBorder();
3345 } 3308 }
3346 3309
3347 } // namespace blink 3310 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderBox.h ('k') | sky/engine/core/rendering/RenderObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698