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

Side by Side Diff: Source/core/rendering/RenderImage.cpp

Issue 516603003: Revert of Make the compositing assert disabler for paint invalidation more targeted. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLCanvasElement.cpp ('k') | Source/core/rendering/RenderLayer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 24 matching lines...) Expand all
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
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
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
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
OLDNEW
« no previous file with comments | « Source/core/html/HTMLCanvasElement.cpp ('k') | Source/core/rendering/RenderLayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698