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 24 matching lines...) Expand all Loading... |
35 #include "core/fetch/ResourceLoader.h" | 35 #include "core/fetch/ResourceLoader.h" |
36 #include "core/frame/LocalFrame.h" | 36 #include "core/frame/LocalFrame.h" |
37 #include "core/html/HTMLAreaElement.h" | 37 #include "core/html/HTMLAreaElement.h" |
38 #include "core/html/HTMLImageElement.h" | 38 #include "core/html/HTMLImageElement.h" |
39 #include "core/html/HTMLInputElement.h" | 39 #include "core/html/HTMLInputElement.h" |
40 #include "core/html/HTMLMapElement.h" | 40 #include "core/html/HTMLMapElement.h" |
41 #include "core/inspector/InspectorInstrumentation.h" | 41 #include "core/inspector/InspectorInstrumentation.h" |
42 #include "core/inspector/InspectorTraceEvents.h" | 42 #include "core/inspector/InspectorTraceEvents.h" |
43 #include "core/rendering/HitTestResult.h" | 43 #include "core/rendering/HitTestResult.h" |
44 #include "core/rendering/PaintInfo.h" | 44 #include "core/rendering/PaintInfo.h" |
| 45 #include "core/rendering/RenderLayer.h" |
45 #include "core/rendering/RenderView.h" | 46 #include "core/rendering/RenderView.h" |
46 #include "core/rendering/TextRunConstructor.h" | 47 #include "core/rendering/TextRunConstructor.h" |
47 #include "core/svg/graphics/SVGImage.h" | 48 #include "core/svg/graphics/SVGImage.h" |
48 #include "platform/fonts/Font.h" | 49 #include "platform/fonts/Font.h" |
49 #include "platform/fonts/FontCache.h" | 50 #include "platform/fonts/FontCache.h" |
50 #include "platform/graphics/GraphicsContext.h" | 51 #include "platform/graphics/GraphicsContext.h" |
51 #include "platform/graphics/GraphicsContextStateSaver.h" | 52 #include "platform/graphics/GraphicsContextStateSaver.h" |
52 | 53 |
53 namespace blink { | 54 namespace blink { |
54 | 55 |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 paintInvalidationRect = enclosingIntRect(mapRect(*rect, FloatRect(FloatP
oint(), imageSizeWithoutZoom), contentBoxRect())); | 245 paintInvalidationRect = enclosingIntRect(mapRect(*rect, FloatRect(FloatP
oint(), imageSizeWithoutZoom), contentBoxRect())); |
245 // Guard against too-large changed rects. | 246 // Guard against too-large changed rects. |
246 paintInvalidationRect.intersect(contentBoxRect()); | 247 paintInvalidationRect.intersect(contentBoxRect()); |
247 } else { | 248 } else { |
248 paintInvalidationRect = contentBoxRect(); | 249 paintInvalidationRect = contentBoxRect(); |
249 } | 250 } |
250 | 251 |
251 { | 252 { |
252 // FIXME: We should not be allowing paint invalidations during layout. c
rbug.com/339584 | 253 // FIXME: We should not be allowing paint invalidations during layout. c
rbug.com/339584 |
253 AllowPaintInvalidationScope scoper(frameView()); | 254 AllowPaintInvalidationScope scoper(frameView()); |
| 255 DisableCompositingQueryAsserts disabler; |
254 invalidatePaintRectangle(paintInvalidationRect); | 256 invalidatePaintRectangle(paintInvalidationRect); |
255 } | 257 } |
256 | 258 |
257 // Tell any potential compositing layers that the image needs updating. | 259 // Tell any potential compositing layers that the image needs updating. |
258 contentChanged(ImageChanged); | 260 contentChanged(ImageChanged); |
259 } | 261 } |
260 | 262 |
261 void RenderImage::notifyFinished(Resource* newImage) | 263 void RenderImage::notifyFinished(Resource* newImage) |
262 { | 264 { |
263 if (!m_imageResource) | 265 if (!m_imageResource) |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 if (path.isEmpty()) | 430 if (path.isEmpty()) |
429 return; | 431 return; |
430 | 432 |
431 RenderStyle* areaElementStyle = areaElement->computedStyle(); | 433 RenderStyle* areaElementStyle = areaElement->computedStyle(); |
432 unsigned short outlineWidth = areaElementStyle->outlineWidth(); | 434 unsigned short outlineWidth = areaElementStyle->outlineWidth(); |
433 | 435 |
434 IntRect paintInvalidationRect = enclosingIntRect(path.boundingRect()); | 436 IntRect paintInvalidationRect = enclosingIntRect(path.boundingRect()); |
435 paintInvalidationRect.moveBy(-absoluteContentBox().location()); | 437 paintInvalidationRect.moveBy(-absoluteContentBox().location()); |
436 paintInvalidationRect.inflate(outlineWidth); | 438 paintInvalidationRect.inflate(outlineWidth); |
437 | 439 |
438 invalidatePaintRectangle(paintInvalidationRect); | 440 paintInvalidationOrMarkForLayout(false, &paintInvalidationRect); |
439 } | 441 } |
440 | 442 |
441 void RenderImage::paintIntoRect(GraphicsContext* context, const LayoutRect& rect
) | 443 void RenderImage::paintIntoRect(GraphicsContext* context, const LayoutRect& rect
) |
442 { | 444 { |
443 IntRect alignedRect = pixelSnappedIntRect(rect); | 445 IntRect alignedRect = pixelSnappedIntRect(rect); |
444 if (!m_imageResource->hasImage() || m_imageResource->errorOccurred() || alig
nedRect.width() <= 0 || alignedRect.height() <= 0) | 446 if (!m_imageResource->hasImage() || m_imageResource->errorOccurred() || alig
nedRect.width() <= 0 || alignedRect.height() <= 0) |
445 return; | 447 return; |
446 | 448 |
447 RefPtr<Image> img = m_imageResource->image(alignedRect.width(), alignedRect.
height()); | 449 RefPtr<Image> img = m_imageResource->image(alignedRect.width(), alignedRect.
height()); |
448 if (!img || img->isNull()) | 450 if (!img || img->isNull()) |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 return 0; | 630 return 0; |
629 | 631 |
630 ImageResource* cachedImage = m_imageResource->cachedImage(); | 632 ImageResource* cachedImage = m_imageResource->cachedImage(); |
631 if (cachedImage && cachedImage->image() && cachedImage->image()->isSVGImage(
)) | 633 if (cachedImage && cachedImage->image() && cachedImage->image()->isSVGImage(
)) |
632 return toSVGImage(cachedImage->image())->embeddedContentBox(); | 634 return toSVGImage(cachedImage->image())->embeddedContentBox(); |
633 | 635 |
634 return 0; | 636 return 0; |
635 } | 637 } |
636 | 638 |
637 } // namespace blink | 639 } // namespace blink |
OLD | NEW |