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

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

Issue 559733005: Move painting code from RenderBoxModelObject into BoxPainter. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Merged. 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/rendering/RenderBoxModelObject.cpp ('k') | Source/core/rendering/RenderObject.h » ('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 21 matching lines...) Expand all
32 #include "core/editing/FrameSelection.h" 32 #include "core/editing/FrameSelection.h"
33 #include "core/fetch/ImageResource.h" 33 #include "core/fetch/ImageResource.h"
34 #include "core/fetch/ResourceLoadPriorityOptimizer.h" 34 #include "core/fetch/ResourceLoadPriorityOptimizer.h"
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/paint/BoxPainter.h"
42 #include "core/rendering/HitTestResult.h" 43 #include "core/rendering/HitTestResult.h"
43 #include "core/rendering/PaintInfo.h" 44 #include "core/rendering/PaintInfo.h"
44 #include "core/rendering/RenderLayer.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"
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 if (!m_imageResource->hasImage() || m_imageResource->errorOccurred() || alig nedRect.width() <= 0 || alignedRect.height() <= 0) 443 if (!m_imageResource->hasImage() || m_imageResource->errorOccurred() || alig nedRect.width() <= 0 || alignedRect.height() <= 0)
443 return; 444 return;
444 445
445 RefPtr<Image> img = m_imageResource->image(alignedRect.width(), alignedRect. height()); 446 RefPtr<Image> img = m_imageResource->image(alignedRect.width(), alignedRect. height());
446 if (!img || img->isNull()) 447 if (!img || img->isNull())
447 return; 448 return;
448 449
449 HTMLImageElement* imageElt = isHTMLImageElement(node()) ? toHTMLImageElement (node()) : 0; 450 HTMLImageElement* imageElt = isHTMLImageElement(node()) ? toHTMLImageElement (node()) : 0;
450 CompositeOperator compositeOperator = imageElt ? imageElt->compositeOperator () : CompositeSourceOver; 451 CompositeOperator compositeOperator = imageElt ? imageElt->compositeOperator () : CompositeSourceOver;
451 Image* image = img.get(); 452 Image* image = img.get();
452 InterpolationQuality interpolationQuality = chooseInterpolationQuality(conte xt, image, image, alignedRect.size()); 453 InterpolationQuality interpolationQuality = BoxPainter::chooseInterpolationQ uality(*this, context, image, image, alignedRect.size());
453 454
454 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintImage", " data", InspectorPaintImageEvent::data(*this)); 455 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintImage", " data", InspectorPaintImageEvent::data(*this));
455 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli ne migrates to tracing. 456 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli ne migrates to tracing.
456 InspectorInstrumentation::willPaintImage(this); 457 InspectorInstrumentation::willPaintImage(this);
457 InterpolationQuality previousInterpolationQuality = context->imageInterpolat ionQuality(); 458 InterpolationQuality previousInterpolationQuality = context->imageInterpolat ionQuality();
458 context->setImageInterpolationQuality(interpolationQuality); 459 context->setImageInterpolationQuality(interpolationQuality);
459 context->drawImage(image, alignedRect, compositeOperator, shouldRespectImage Orientation()); 460 context->drawImage(image, alignedRect, compositeOperator, shouldRespectImage Orientation());
460 context->setImageInterpolationQuality(previousInterpolationQuality); 461 context->setImageInterpolationQuality(previousInterpolationQuality);
461 InspectorInstrumentation::didPaintImage(this); 462 InspectorInstrumentation::didPaintImage(this);
462 } 463 }
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 return 0; 627 return 0;
627 628
628 ImageResource* cachedImage = m_imageResource->cachedImage(); 629 ImageResource* cachedImage = m_imageResource->cachedImage();
629 if (cachedImage && cachedImage->image() && cachedImage->image()->isSVGImage( )) 630 if (cachedImage && cachedImage->image() && cachedImage->image()->isSVGImage( ))
630 return toSVGImage(cachedImage->image())->embeddedContentBox(); 631 return toSVGImage(cachedImage->image())->embeddedContentBox();
631 632
632 return 0; 633 return 0;
633 } 634 }
634 635
635 } // namespace blink 636 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBoxModelObject.cpp ('k') | Source/core/rendering/RenderObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698