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

Unified Diff: Source/platform/graphics/GraphicsContextState.cpp

Issue 1236363003: Drop WebCoreInterpolationQualityToSkFilterQuality (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Space Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/paint/SVGPaintContext.cpp ('k') | Source/platform/graphics/skia/SkiaUtils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/GraphicsContextState.cpp
diff --git a/Source/platform/graphics/GraphicsContextState.cpp b/Source/platform/graphics/GraphicsContextState.cpp
index 0cc57a61bfb346634b90f2190aae994ecc03648e..e23ba5adcd71f7b37811e6ce595a743a237383fb 100644
--- a/Source/platform/graphics/GraphicsContextState.cpp
+++ b/Source/platform/graphics/GraphicsContextState.cpp
@@ -7,6 +7,15 @@
namespace blink {
+static inline SkFilterQuality filterQualityForPaint(InterpolationQuality quality)
+{
+ // The filter quality "selected" here will primarily be used when painting a
+ // primitive using one of the SkPaints below. For the most part this will
+ // not affect things that are part of the Image class hierarchy (which use
+ // the unmodified m_interpolationQuality.)
+ return quality != InterpolationNone ? kLow_SkFilterQuality : kNone_SkFilterQuality;
+}
+
GraphicsContextState::GraphicsContextState()
: m_strokeColor(Color::black)
, m_fillColor(Color::black)
@@ -21,10 +30,10 @@ GraphicsContextState::GraphicsContextState()
m_strokePaint.setStrokeCap(SkPaint::kDefault_Cap);
m_strokePaint.setStrokeJoin(SkPaint::kDefault_Join);
m_strokePaint.setStrokeMiter(SkFloatToScalar(m_strokeData.miterLimit()));
- m_strokePaint.setFilterQuality(WebCoreInterpolationQualityToSkFilterQuality(m_interpolationQuality));
+ m_strokePaint.setFilterQuality(filterQualityForPaint(m_interpolationQuality));
m_strokePaint.setAntiAlias(m_shouldAntialias);
m_fillPaint.setColor(m_fillColor.rgb());
- m_fillPaint.setFilterQuality(WebCoreInterpolationQualityToSkFilterQuality(m_interpolationQuality));
+ m_fillPaint.setFilterQuality(filterQualityForPaint(m_interpolationQuality));
m_fillPaint.setAntiAlias(m_shouldAntialias);
}
@@ -155,8 +164,8 @@ void GraphicsContextState::setColorFilter(PassRefPtr<SkColorFilter> colorFilter)
void GraphicsContextState::setInterpolationQuality(InterpolationQuality quality)
{
m_interpolationQuality = quality;
- m_strokePaint.setFilterQuality(WebCoreInterpolationQualityToSkFilterQuality(quality));
- m_fillPaint.setFilterQuality(WebCoreInterpolationQualityToSkFilterQuality(quality));
+ m_strokePaint.setFilterQuality(filterQualityForPaint(quality));
+ m_fillPaint.setFilterQuality(filterQualityForPaint(quality));
}
void GraphicsContextState::setShouldAntialias(bool shouldAntialias)
« no previous file with comments | « Source/core/paint/SVGPaintContext.cpp ('k') | Source/platform/graphics/skia/SkiaUtils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698