| OLD | NEW |
| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(); |
| 167 } | 167 } |
| 168 | |
| 169 LayoutRect paintInvalidationRect; | |
| 170 if (rect) { | |
| 171 // The image changed rect is in source image coordinates, | |
| 172 // so map from the bounds of the image to the contentsBox. | |
| 173 paintInvalidationRect = enclosingIntRect(mapRect(*rect, FloatRect(FloatP
oint(), m_imageResource->imageSize()), contentBoxRect())); | |
| 174 // Guard against too-large changed rects. | |
| 175 paintInvalidationRect.intersect(contentBoxRect()); | |
| 176 } else { | |
| 177 paintInvalidationRect = contentBoxRect(); | |
| 178 } | |
| 179 | |
| 180 { | |
| 181 // FIXME: We should not be allowing paint invalidations during layout. c
rbug.com/339584 | |
| 182 AllowPaintInvalidationScope scoper(frameView()); | |
| 183 invalidatePaintRectangle(paintInvalidationRect); | |
| 184 } | |
| 185 } | 168 } |
| 186 | 169 |
| 187 void RenderImage::notifyFinished(Resource* newImage) | 170 void RenderImage::notifyFinished(Resource* newImage) |
| 188 { | 171 { |
| 189 if (!m_imageResource) | 172 if (!m_imageResource) |
| 190 return; | 173 return; |
| 191 | 174 |
| 192 if (documentBeingDestroyed()) | 175 if (documentBeingDestroyed()) |
| 193 return; | 176 return; |
| 194 | 177 |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 return; | 324 return; |
| 342 } | 325 } |
| 343 } | 326 } |
| 344 | 327 |
| 345 bool RenderImage::needsPreferredWidthsRecalculation() const | 328 bool RenderImage::needsPreferredWidthsRecalculation() const |
| 346 { | 329 { |
| 347 return RenderReplaced::needsPreferredWidthsRecalculation(); | 330 return RenderReplaced::needsPreferredWidthsRecalculation(); |
| 348 } | 331 } |
| 349 | 332 |
| 350 } // namespace blink | 333 } // namespace blink |
| OLD | NEW |