diff options
author | jhaas@chromium.org <jhaas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-11 16:20:27 +0000 |
---|---|---|
committer | jhaas@chromium.org <jhaas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-11 16:20:27 +0000 |
commit | 9b900694217a563c2482d7b5b2f2d3437e0c9358 (patch) | |
tree | 33383c05bc90d49e1b1b43016635d2fd20ced9dc /webkit/port | |
parent | 806b9c6f00c6d21259d049d21ebea52de9b47663 (diff) | |
download | chromium_src-9b900694217a563c2482d7b5b2f2d3437e0c9358.zip chromium_src-9b900694217a563c2482d7b5b2f2d3437e0c9358.tar.gz chromium_src-9b900694217a563c2482d7b5b2f2d3437e0c9358.tar.bz2 |
Added code to support the setUseAntialiasing() method, which is invoked
when an object is specified with shape-rendering="crispEdges"
Review URL: http://codereview.chromium.org/1830
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2061 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/port')
-rw-r--r-- | webkit/port/platform/graphics/GraphicsContextSkia.cpp | 3 | ||||
-rw-r--r-- | webkit/port/platform/graphics/SkPaintContext.cpp | 8 | ||||
-rw-r--r-- | webkit/port/platform/graphics/SkPaintContext.h | 1 |
3 files changed, 9 insertions, 3 deletions
diff --git a/webkit/port/platform/graphics/GraphicsContextSkia.cpp b/webkit/port/platform/graphics/GraphicsContextSkia.cpp index e169a1d..90eb7ea 100644 --- a/webkit/port/platform/graphics/GraphicsContextSkia.cpp +++ b/webkit/port/platform/graphics/GraphicsContextSkia.cpp @@ -24,7 +24,6 @@ #include "Assertions.h" #include "AffineTransform.h" #include "NativeImageSkia.h" -#include "NotImplemented.h" #include "SkBlurDrawLooper.h" #include "SkCornerPathEffect.h" #include "SkiaUtils.h" @@ -1297,7 +1296,7 @@ void GraphicsContext::setUseAntialiasing(bool enable) { if (paintingDisabled()) return; - notImplemented(); + m_data->setUseAntialiasing(enable); } void GraphicsContext::setShouldDelete(bool should_delete) diff --git a/webkit/port/platform/graphics/SkPaintContext.cpp b/webkit/port/platform/graphics/SkPaintContext.cpp index 57c8f4c..4bf8cd1 100644 --- a/webkit/port/platform/graphics/SkPaintContext.cpp +++ b/webkit/port/platform/graphics/SkPaintContext.cpp @@ -66,6 +66,7 @@ struct SkPaintContext::State { StrokeStyle mStrokeStyle; SkColor mStrokeColor; float mStrokeThickness; + bool mUseAntialiasing; SkDashPathEffect* mDash; SkShader* mGradient; @@ -84,6 +85,7 @@ struct SkPaintContext::State { mStrokeStyle(SolidStroke), mStrokeColor(0x0FF000000), mStrokeThickness(0), + mUseAntialiasing(true), mDash(NULL), mGradient(NULL), mPattern(NULL) { @@ -189,7 +191,7 @@ void SkPaintContext::setup_paint_common(SkPaint* paint) const { } #endif - paint->setAntiAlias(true); + paint->setAntiAlias(state_->mUseAntialiasing); paint->setPorterDuffXfermode(state_->mPorterDuffMode); paint->setLooper(state_->mLooper); @@ -295,6 +297,10 @@ void SkPaintContext::setStrokeThickness(float thickness) { state_->mStrokeThickness = thickness; } +void SkPaintContext::setUseAntialiasing(bool enable) { + state_->mUseAntialiasing = enable; +} + SkColor SkPaintContext::fillColor() const { return state_->mFillColor; } diff --git a/webkit/port/platform/graphics/SkPaintContext.h b/webkit/port/platform/graphics/SkPaintContext.h index f068e50..0d7aaae 100644 --- a/webkit/port/platform/graphics/SkPaintContext.h +++ b/webkit/port/platform/graphics/SkPaintContext.h @@ -65,6 +65,7 @@ class SkPaintContext { void setStrokeStyle(StrokeStyle strokestyle); void setStrokeColor(SkColor strokecolor); void setStrokeThickness(float thickness); + void setUseAntialiasing(bool enable); void beginPath(); void addPath(const SkPath& path); |