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