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

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

Issue 2899633002: Make EImageRendering an enum class. (Closed)
Patch Set: Rebase Created 3 years, 6 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(content_rect)); 52 context.Clip(FloatRect(content_rect));
53 } 53 }
54 54
55 // FIXME: InterpolationNone should be used if ImageRenderingOptimizeContrast 55 // FIXME: InterpolationNone should be used if ImageRenderingOptimizeContrast
56 // is set. See bug for more details: crbug.com/353716. 56 // is set. See bug for more details: crbug.com/353716.
57 InterpolationQuality interpolation_quality = 57 InterpolationQuality interpolation_quality =
58 layout_html_canvas_.Style()->ImageRendering() == 58 layout_html_canvas_.Style()->ImageRendering() ==
59 kImageRenderingOptimizeContrast 59 EImageRendering::kOptimizeContrast
60 ? kInterpolationLow 60 ? kInterpolationLow
61 : CanvasDefaultInterpolationQuality; 61 : CanvasDefaultInterpolationQuality;
62 if (layout_html_canvas_.Style()->ImageRendering() == kImageRenderingPixelated) 62 if (layout_html_canvas_.Style()->ImageRendering() ==
63 EImageRendering::kPixelated)
63 interpolation_quality = kInterpolationNone; 64 interpolation_quality = kInterpolationNone;
64 65
65 InterpolationQuality previous_interpolation_quality = 66 InterpolationQuality previous_interpolation_quality =
66 context.ImageInterpolationQuality(); 67 context.ImageInterpolationQuality();
67 context.SetImageInterpolationQuality(interpolation_quality); 68 context.SetImageInterpolationQuality(interpolation_quality);
68 canvas->Paint(context, paint_rect); 69 canvas->Paint(context, paint_rect);
69 context.SetImageInterpolationQuality(previous_interpolation_quality); 70 context.SetImageInterpolationQuality(previous_interpolation_quality);
70 71
71 if (clip) 72 if (clip)
72 context.Restore(); 73 context.Restore();
73 } 74 }
74 75
75 } // namespace blink 76 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/page/DragController.cpp ('k') | third_party/WebKit/Source/core/style/ComputedStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698