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

Side by Side Diff: Source/core/paint/ImagePainter.cpp

Issue 688743002: Remove the composite attribute on <img> (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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/HTMLImageElement.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/paint/ImagePainter.h" 6 #include "core/paint/ImagePainter.h"
7 7
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/dom/Element.h" 9 #include "core/dom/Element.h"
10 #include "core/editing/FrameSelection.h" 10 #include "core/editing/FrameSelection.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 void ImagePainter::paintIntoRect(GraphicsContext* context, const LayoutRect& rec t) 175 void ImagePainter::paintIntoRect(GraphicsContext* context, const LayoutRect& rec t)
176 { 176 {
177 IntRect alignedRect = pixelSnappedIntRect(rect); 177 IntRect alignedRect = pixelSnappedIntRect(rect);
178 if (!m_renderImage.imageResource()->hasImage() || m_renderImage.imageResourc e()->errorOccurred() || alignedRect.width() <= 0 || alignedRect.height() <= 0) 178 if (!m_renderImage.imageResource()->hasImage() || m_renderImage.imageResourc e()->errorOccurred() || alignedRect.width() <= 0 || alignedRect.height() <= 0)
179 return; 179 return;
180 180
181 RefPtr<Image> img = m_renderImage.imageResource()->image(alignedRect.width() , alignedRect.height()); 181 RefPtr<Image> img = m_renderImage.imageResource()->image(alignedRect.width() , alignedRect.height());
182 if (!img || img->isNull()) 182 if (!img || img->isNull())
183 return; 183 return;
184 184
185 HTMLImageElement* imageElt = isHTMLImageElement(m_renderImage.node()) ? toHT MLImageElement(m_renderImage.node()) : 0;
186 CompositeOperator compositeOperator = imageElt ? imageElt->compositeOperator () : CompositeSourceOver;
187 Image* image = img.get(); 185 Image* image = img.get();
188 InterpolationQuality interpolationQuality = BoxPainter::chooseInterpolationQ uality(m_renderImage, context, image, image, alignedRect.size()); 186 InterpolationQuality interpolationQuality = BoxPainter::chooseInterpolationQ uality(m_renderImage, context, image, image, alignedRect.size());
189 187
190 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintImage", " data", InspectorPaintImageEvent::data(m_renderImage)); 188 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintImage", " data", InspectorPaintImageEvent::data(m_renderImage));
191 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli ne migrates to tracing. 189 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli ne migrates to tracing.
192 InspectorInstrumentation::willPaintImage(&m_renderImage); 190 InspectorInstrumentation::willPaintImage(&m_renderImage);
193 InterpolationQuality previousInterpolationQuality = context->imageInterpolat ionQuality(); 191 InterpolationQuality previousInterpolationQuality = context->imageInterpolat ionQuality();
194 context->setImageInterpolationQuality(interpolationQuality); 192 context->setImageInterpolationQuality(interpolationQuality);
195 context->drawImage(image, alignedRect, compositeOperator, m_renderImage.shou ldRespectImageOrientation()); 193 context->drawImage(image, alignedRect, CompositeSourceOver, m_renderImage.sh ouldRespectImageOrientation());
196 context->setImageInterpolationQuality(previousInterpolationQuality); 194 context->setImageInterpolationQuality(previousInterpolationQuality);
197 InspectorInstrumentation::didPaintImage(&m_renderImage); 195 InspectorInstrumentation::didPaintImage(&m_renderImage);
198 } 196 }
199 197
200 } // namespace blink 198 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/html/HTMLImageElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698