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

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

Issue 840483004: Get rid of the *AndFullPaintInvalidation methods. (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
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) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2006 Allan Sandfeld Jensen (kde@carewolf.com)
6 * (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 6 * (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
8 * Copyright (C) 2010 Google Inc. All rights reserved. 8 * Copyright (C) 2010 Google Inc. All rights reserved.
9 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. 9 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved.
10 * 10 *
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 146
147 // If the actual area occupied by the image has changed and it is not constr ained by style then a layout is required. 147 // If the actual area occupied by the image has changed and it is not constr ained by style then a layout is required.
148 bool imageSizeIsConstrained = style()->logicalWidth().isSpecified() && style ()->logicalHeight().isSpecified(); 148 bool imageSizeIsConstrained = style()->logicalWidth().isSpecified() && style ()->logicalHeight().isSpecified();
149 149
150 // FIXME: We only need to recompute the containing block's preferred size if the containing block's size 150 // FIXME: We only need to recompute the containing block's preferred size if the containing block's size
151 // depends on the image's size (i.e., the container uses shrink-to-fit sizin g). 151 // depends on the image's size (i.e., the container uses shrink-to-fit sizin g).
152 // There's no easy way to detect that shrink-to-fit is needed, always force a layout. 152 // There's no easy way to detect that shrink-to-fit is needed, always force a layout.
153 bool containingBlockNeedsToRecomputePreferredSize = style()->logicalWidth(). isPercent() || style()->logicalMaxWidth().isPercent() || style()->logicalMinWid th().isPercent(); 153 bool containingBlockNeedsToRecomputePreferredSize = style()->logicalWidth(). isPercent() || style()->logicalMaxWidth().isPercent() || style()->logicalMinWid th().isPercent();
154 154
155 if (imageSourceHasChangedSize && (!imageSizeIsConstrained || containingBlock NeedsToRecomputePreferredSize)) { 155 if (imageSourceHasChangedSize && (!imageSizeIsConstrained || containingBlock NeedsToRecomputePreferredSize)) {
156 setNeedsLayoutAndFullPaintInvalidation(); 156 setNeedsLayout();
157 return; 157 return;
158 } 158 }
159 159
160 // The image hasn't changed in size or its style constrains its size, so a p aint invalidation will suffice. 160 // The image hasn't changed in size or its style constrains its size, so a p aint invalidation will suffice.
161 if (everHadLayout() && !selfNeedsLayout()) { 161 if (everHadLayout() && !selfNeedsLayout()) {
162 // The inner content rectangle is calculated during layout, but may need an update now 162 // The inner content rectangle is calculated during layout, but may need an update now
163 // (unless the box has already been scheduled for layout). In order to c alculate it, we 163 // (unless the box has already been scheduled for layout). In order to c alculate it, we
164 // may need values from the containing block, though, so make sure that we're not too 164 // may need values from the containing block, though, so make sure that we're not too
165 // early. It may be that layout hasn't even taken place once yet. 165 // early. It may be that layout hasn't even taken place once yet.
166 updateInnerContentRect(); 166 updateInnerContentRect();
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 return; 323 return;
324 } 324 }
325 } 325 }
326 326
327 bool RenderImage::needsPreferredWidthsRecalculation() const 327 bool RenderImage::needsPreferredWidthsRecalculation() const
328 { 328 {
329 return RenderReplaced::needsPreferredWidthsRecalculation(); 329 return RenderReplaced::needsPreferredWidthsRecalculation();
330 } 330 }
331 331
332 } // namespace blink 332 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderHTMLCanvas.cpp ('k') | sky/engine/core/rendering/RenderInline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698