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

Side by Side Diff: Source/core/rendering/RenderHTMLCanvas.cpp

Issue 201513003: Implement InterpolationMedium to filter animated images (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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) 2004, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 LayoutRect paintRect = replacedContentRect(); 66 LayoutRect paintRect = replacedContentRect();
67 paintRect.moveBy(paintOffset); 67 paintRect.moveBy(paintOffset);
68 68
69 bool clip = !contentRect.contains(paintRect); 69 bool clip = !contentRect.contains(paintRect);
70 if (clip) { 70 if (clip) {
71 // Not allowed to overflow the content box. 71 // Not allowed to overflow the content box.
72 paintInfo.context->save(); 72 paintInfo.context->save();
73 paintInfo.context->clip(pixelSnappedIntRect(contentRect)); 73 paintInfo.context->clip(pixelSnappedIntRect(contentRect));
74 } 74 }
75 75
76 // FIXME: InterpolationNone should be used if ImageRenderingOptimizeContrast is set.
Stephen White 2014/03/18 17:26:43 Please log a bug for this, if there isn't one alre
Alpha Left Google 2014/03/18 22:59:13 Done.
76 bool useLowQualityScale = style()->imageRendering() == ImageRenderingOptimiz eContrast; 77 bool useLowQualityScale = style()->imageRendering() == ImageRenderingOptimiz eContrast;
77 toHTMLCanvasElement(node())->paint(context, paintRect, useLowQualityScale); 78 toHTMLCanvasElement(node())->paint(context, paintRect, useLowQualityScale ? InterpolationLow : DefaultInterpolationQuality);
78 79
79 if (clip) 80 if (clip)
80 context->restore(); 81 context->restore();
81 } 82 }
82 83
83 void RenderHTMLCanvas::canvasSizeChanged() 84 void RenderHTMLCanvas::canvasSizeChanged()
84 { 85 {
85 IntSize canvasSize = toHTMLCanvasElement(node())->size(); 86 IntSize canvasSize = toHTMLCanvasElement(node())->size();
86 LayoutSize zoomedSize(canvasSize.width() * style()->effectiveZoom(), canvasS ize.height() * style()->effectiveZoom()); 87 LayoutSize zoomedSize(canvasSize.width() * style()->effectiveZoom(), canvasS ize.height() * style()->effectiveZoom());
87 88
(...skipping 12 matching lines...) Expand all
100 updateLogicalWidth(); 101 updateLogicalWidth();
101 updateLogicalHeight(); 102 updateLogicalHeight();
102 if (oldSize == size()) 103 if (oldSize == size())
103 return; 104 return;
104 105
105 if (!selfNeedsLayout()) 106 if (!selfNeedsLayout())
106 setNeedsLayout(); 107 setNeedsLayout();
107 } 108 }
108 109
109 } // namespace WebCore 110 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698