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

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: 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
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 22 matching lines...) Expand all
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/inspector/InspectorTraceEvents.h" 42 #include "core/inspector/InspectorTraceEvents.h"
43 #include "core/paint/BoxPainter.h"
43 #include "core/rendering/HitTestResult.h" 44 #include "core/rendering/HitTestResult.h"
44 #include "core/rendering/PaintInfo.h" 45 #include "core/rendering/PaintInfo.h"
45 #include "core/rendering/RenderLayer.h" 46 #include "core/rendering/RenderLayer.h"
46 #include "core/rendering/RenderView.h" 47 #include "core/rendering/RenderView.h"
47 #include "core/rendering/TextRunConstructor.h" 48 #include "core/rendering/TextRunConstructor.h"
48 #include "core/svg/graphics/SVGImage.h" 49 #include "core/svg/graphics/SVGImage.h"
49 #include "platform/fonts/Font.h" 50 #include "platform/fonts/Font.h"
50 #include "platform/fonts/FontCache.h" 51 #include "platform/fonts/FontCache.h"
51 #include "platform/graphics/GraphicsContext.h" 52 #include "platform/graphics/GraphicsContext.h"
52 #include "platform/graphics/GraphicsContextStateSaver.h" 53 #include "platform/graphics/GraphicsContextStateSaver.h"
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 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)
444 return; 445 return;
445 446
446 RefPtr<Image> img = m_imageResource->image(alignedRect.width(), alignedRect. height()); 447 RefPtr<Image> img = m_imageResource->image(alignedRect.width(), alignedRect. height());
447 if (!img || img->isNull()) 448 if (!img || img->isNull())
448 return; 449 return;
449 450
450 HTMLImageElement* imageElt = isHTMLImageElement(node()) ? toHTMLImageElement (node()) : 0; 451 HTMLImageElement* imageElt = isHTMLImageElement(node()) ? toHTMLImageElement (node()) : 0;
451 CompositeOperator compositeOperator = imageElt ? imageElt->compositeOperator () : CompositeSourceOver; 452 CompositeOperator compositeOperator = imageElt ? imageElt->compositeOperator () : CompositeSourceOver;
452 Image* image = img.get(); 453 Image* image = img.get();
453 InterpolationQuality interpolationQuality = chooseInterpolationQuality(conte xt, image, image, alignedRect.size()); 454 InterpolationQuality interpolationQuality = BoxPainter(*this).chooseInterpol ationQuality(context, image, image, alignedRect.size());
454 455
455 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintImage", " data", InspectorPaintImageEvent::data(*this)); 456 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintImage", " data", InspectorPaintImageEvent::data(*this));
456 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli ne migrates to tracing. 457 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli ne migrates to tracing.
457 InspectorInstrumentation::willPaintImage(this); 458 InspectorInstrumentation::willPaintImage(this);
458 InterpolationQuality previousInterpolationQuality = context->imageInterpolat ionQuality(); 459 InterpolationQuality previousInterpolationQuality = context->imageInterpolat ionQuality();
459 context->setImageInterpolationQuality(interpolationQuality); 460 context->setImageInterpolationQuality(interpolationQuality);
460 context->drawImage(image, alignedRect, compositeOperator, shouldRespectImage Orientation()); 461 context->drawImage(image, alignedRect, compositeOperator, shouldRespectImage Orientation());
461 context->setImageInterpolationQuality(previousInterpolationQuality); 462 context->setImageInterpolationQuality(previousInterpolationQuality);
462 InspectorInstrumentation::didPaintImage(this); 463 InspectorInstrumentation::didPaintImage(this);
463 } 464 }
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 return 0; 628 return 0;
628 629
629 ImageResource* cachedImage = m_imageResource->cachedImage(); 630 ImageResource* cachedImage = m_imageResource->cachedImage();
630 if (cachedImage && cachedImage->image() && cachedImage->image()->isSVGImage( )) 631 if (cachedImage && cachedImage->image() && cachedImage->image()->isSVGImage( ))
631 return toSVGImage(cachedImage->image())->embeddedContentBox(); 632 return toSVGImage(cachedImage->image())->embeddedContentBox();
632 633
633 return 0; 634 return 0;
634 } 635 }
635 636
636 } // namespace blink 637 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698