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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 repaintRect = enclosingIntRect(mapRect(*rect, FloatRect(FloatPoint(), im
ageSizeWithoutZoom), contentBoxRect())); | 244 repaintRect = enclosingIntRect(mapRect(*rect, FloatRect(FloatPoint(), im
ageSizeWithoutZoom), contentBoxRect())); |
245 // Guard against too-large changed rects. | 245 // Guard against too-large changed rects. |
246 repaintRect.intersect(contentBoxRect()); | 246 repaintRect.intersect(contentBoxRect()); |
247 } else { | 247 } else { |
248 repaintRect = contentBoxRect(); | 248 repaintRect = contentBoxRect(); |
249 } | 249 } |
250 | 250 |
251 { | 251 { |
252 // FIXME: We should not be allowing repaint during layout. crbug.com/339
584 | 252 // FIXME: We should not be allowing repaint during layout. crbug.com/339
584 |
253 AllowPaintInvalidationScope scoper(frameView()); | 253 AllowPaintInvalidationScope scoper(frameView()); |
254 repaintRectangle(repaintRect); | 254 invalidatePaintRectangle(repaintRect); |
255 } | 255 } |
256 | 256 |
257 // Tell any potential compositing layers that the image needs updating. | 257 // Tell any potential compositing layers that the image needs updating. |
258 contentChanged(ImageChanged); | 258 contentChanged(ImageChanged); |
259 } | 259 } |
260 | 260 |
261 void RenderImage::notifyFinished(Resource* newImage) | 261 void RenderImage::notifyFinished(Resource* newImage) |
262 { | 262 { |
263 if (!m_imageResource) | 263 if (!m_imageResource) |
264 return; | 264 return; |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 if (path.isEmpty()) | 431 if (path.isEmpty()) |
432 return; | 432 return; |
433 | 433 |
434 RenderStyle* areaElementStyle = areaElement->computedStyle(); | 434 RenderStyle* areaElementStyle = areaElement->computedStyle(); |
435 unsigned short outlineWidth = areaElementStyle->outlineWidth(); | 435 unsigned short outlineWidth = areaElementStyle->outlineWidth(); |
436 | 436 |
437 IntRect repaintRect = enclosingIntRect(path.boundingRect()); | 437 IntRect repaintRect = enclosingIntRect(path.boundingRect()); |
438 repaintRect.moveBy(-absoluteContentBox().location()); | 438 repaintRect.moveBy(-absoluteContentBox().location()); |
439 repaintRect.inflate(outlineWidth); | 439 repaintRect.inflate(outlineWidth); |
440 | 440 |
441 repaintRectangle(repaintRect); | 441 invalidatePaintRectangle(repaintRect); |
442 } | 442 } |
443 | 443 |
444 void RenderImage::paintIntoRect(GraphicsContext* context, const LayoutRect& rect
) | 444 void RenderImage::paintIntoRect(GraphicsContext* context, const LayoutRect& rect
) |
445 { | 445 { |
446 IntRect alignedRect = pixelSnappedIntRect(rect); | 446 IntRect alignedRect = pixelSnappedIntRect(rect); |
447 if (!m_imageResource->hasImage() || m_imageResource->errorOccurred() || alig
nedRect.width() <= 0 || alignedRect.height() <= 0) | 447 if (!m_imageResource->hasImage() || m_imageResource->errorOccurred() || alig
nedRect.width() <= 0 || alignedRect.height() <= 0) |
448 return; | 448 return; |
449 | 449 |
450 RefPtr<Image> img = m_imageResource->image(alignedRect.width(), alignedRect.
height()); | 450 RefPtr<Image> img = m_imageResource->image(alignedRect.width(), alignedRect.
height()); |
451 if (!img || img->isNull()) | 451 if (!img || img->isNull()) |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 return 0; | 627 return 0; |
628 | 628 |
629 ImageResource* cachedImage = m_imageResource->cachedImage(); | 629 ImageResource* cachedImage = m_imageResource->cachedImage(); |
630 if (cachedImage && cachedImage->image() && cachedImage->image()->isSVGImage(
)) | 630 if (cachedImage && cachedImage->image() && cachedImage->image()->isSVGImage(
)) |
631 return toSVGImage(cachedImage->image())->embeddedContentBox(); | 631 return toSVGImage(cachedImage->image())->embeddedContentBox(); |
632 | 632 |
633 return 0; | 633 return 0; |
634 } | 634 } |
635 | 635 |
636 } // namespace WebCore | 636 } // namespace WebCore |
OLD | NEW |