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

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

Issue 2392443009: reflow comments in core/paint (Closed)
Patch Set: Created 4 years, 2 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
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 "core/paint/HTMLCanvasPainter.h" 5 #include "core/paint/HTMLCanvasPainter.h"
6 6
7 #include "core/html/HTMLCanvasElement.h" 7 #include "core/html/HTMLCanvasElement.h"
8 #include "core/html/canvas/CanvasRenderingContext.h" 8 #include "core/html/canvas/CanvasRenderingContext.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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 LayoutObjectDrawingRecorder drawingRecorder(context, m_layoutHTMLCanvas, 45 LayoutObjectDrawingRecorder drawingRecorder(context, m_layoutHTMLCanvas,
46 paintInfo.phase, contentRect); 46 paintInfo.phase, contentRect);
47 47
48 bool clip = !contentRect.contains(paintRect); 48 bool clip = !contentRect.contains(paintRect);
49 if (clip) { 49 if (clip) {
50 context.save(); 50 context.save();
51 // TODO(chrishtr): this should be pixel-snapped. 51 // TODO(chrishtr): this should be pixel-snapped.
52 context.clip(FloatRect(contentRect)); 52 context.clip(FloatRect(contentRect));
53 } 53 }
54 54
55 // FIXME: InterpolationNone should be used if ImageRenderingOptimizeContrast i s set. 55 // FIXME: InterpolationNone should be used if ImageRenderingOptimizeContrast
56 // See bug for more details: crbug.com/353716. 56 // is set. See bug for more details: crbug.com/353716.
57 InterpolationQuality interpolationQuality = 57 InterpolationQuality interpolationQuality =
58 m_layoutHTMLCanvas.style()->imageRendering() == 58 m_layoutHTMLCanvas.style()->imageRendering() ==
59 ImageRenderingOptimizeContrast 59 ImageRenderingOptimizeContrast
60 ? InterpolationLow 60 ? InterpolationLow
61 : CanvasDefaultInterpolationQuality; 61 : CanvasDefaultInterpolationQuality;
62 if (m_layoutHTMLCanvas.style()->imageRendering() == ImageRenderingPixelated) 62 if (m_layoutHTMLCanvas.style()->imageRendering() == ImageRenderingPixelated)
63 interpolationQuality = InterpolationNone; 63 interpolationQuality = InterpolationNone;
64 64
65 InterpolationQuality previousInterpolationQuality = 65 InterpolationQuality previousInterpolationQuality =
66 context.imageInterpolationQuality(); 66 context.imageInterpolationQuality();
67 context.setImageInterpolationQuality(interpolationQuality); 67 context.setImageInterpolationQuality(interpolationQuality);
68 canvas->paint(context, paintRect); 68 canvas->paint(context, paintRect);
69 context.setImageInterpolationQuality(previousInterpolationQuality); 69 context.setImageInterpolationQuality(previousInterpolationQuality);
70 70
71 if (clip) 71 if (clip)
72 context.restore(); 72 context.restore();
73 } 73 }
74 74
75 } // namespace blink 75 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/GridPainter.cpp ('k') | third_party/WebKit/Source/core/paint/ImagePainter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698