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

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

Issue 1303413004: Convert some call sites to use explicit LayoutRect->FloatRect conversion. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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/paint/DeprecatedPaintLayerClipper.cpp ('k') | Source/core/paint/ImagePainter.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 // 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/HTMLCanvasPainter.h" 6 #include "core/paint/HTMLCanvasPainter.h"
7 7
8 #include "core/html/HTMLCanvasElement.h" 8 #include "core/html/HTMLCanvasElement.h"
9 #include "core/layout/LayoutHTMLCanvas.h" 9 #include "core/layout/LayoutHTMLCanvas.h"
10 #include "core/paint/LayoutObjectDrawingRecorder.h" 10 #include "core/paint/LayoutObjectDrawingRecorder.h"
(...skipping 16 matching lines...) Expand all
27 27
28 LayoutObjectDrawingRecorder drawingRecorder(*context, m_layoutHTMLCanvas, pa intInfo.phase, contentRect); 28 LayoutObjectDrawingRecorder drawingRecorder(*context, m_layoutHTMLCanvas, pa intInfo.phase, contentRect);
29 #if ENABLE(ASSERT) 29 #if ENABLE(ASSERT)
30 // The drawing may be in display list mode or image mode, producing differen t pictures for the same result. 30 // The drawing may be in display list mode or image mode, producing differen t pictures for the same result.
31 drawingRecorder.setUnderInvalidationCheckingMode(DrawingDisplayItem::CheckBi tmap); 31 drawingRecorder.setUnderInvalidationCheckingMode(DrawingDisplayItem::CheckBi tmap);
32 #endif 32 #endif
33 33
34 bool clip = !contentRect.contains(paintRect); 34 bool clip = !contentRect.contains(paintRect);
35 if (clip) { 35 if (clip) {
36 context->save(); 36 context->save();
37 context->clip(contentRect); 37 // TODO(chrishtr): this should be pixel-snapped.
38 context->clip(FloatRect(contentRect));
38 } 39 }
39 40
40 // FIXME: InterpolationNone should be used if ImageRenderingOptimizeContrast is set. 41 // FIXME: InterpolationNone should be used if ImageRenderingOptimizeContrast is set.
41 // See bug for more details: crbug.com/353716. 42 // See bug for more details: crbug.com/353716.
42 InterpolationQuality interpolationQuality = m_layoutHTMLCanvas.style()->imag eRendering() == ImageRenderingOptimizeContrast ? InterpolationLow : CanvasDefaul tInterpolationQuality; 43 InterpolationQuality interpolationQuality = m_layoutHTMLCanvas.style()->imag eRendering() == ImageRenderingOptimizeContrast ? InterpolationLow : CanvasDefaul tInterpolationQuality;
43 if (m_layoutHTMLCanvas.style()->imageRendering() == ImageRenderingPixelated) 44 if (m_layoutHTMLCanvas.style()->imageRendering() == ImageRenderingPixelated)
44 interpolationQuality = InterpolationNone; 45 interpolationQuality = InterpolationNone;
45 46
46 InterpolationQuality previousInterpolationQuality = context->imageInterpolat ionQuality(); 47 InterpolationQuality previousInterpolationQuality = context->imageInterpolat ionQuality();
47 context->setImageInterpolationQuality(interpolationQuality); 48 context->setImageInterpolationQuality(interpolationQuality);
48 toHTMLCanvasElement(m_layoutHTMLCanvas.node())->paint(context, paintRect); 49 toHTMLCanvasElement(m_layoutHTMLCanvas.node())->paint(context, paintRect);
49 context->setImageInterpolationQuality(previousInterpolationQuality); 50 context->setImageInterpolationQuality(previousInterpolationQuality);
50 51
51 if (clip) 52 if (clip)
52 context->restore(); 53 context->restore();
53 } 54 }
54 55
55 } // namespace blink 56 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/DeprecatedPaintLayerClipper.cpp ('k') | Source/core/paint/ImagePainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698