diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-10-23 16:18:50 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-10-23 16:18:50 +0000 |
commit | 759befb72c558202de65a480c44d7b27428ec312 (patch) | |
tree | 86dce8cc3107f912f870415cd27fa1d261881adf /gm | |
parent | a8aef8bf04b10ad648c448c16f56d8c487819112 (diff) |
use the supplied matrix instead of the texture w/h div for the bicubic GPU effect
BUG=
R=bsalomon@google.com, caryclark@google.com
Author: humper@google.com
Review URL: https://codereview.chromium.org/37003005
git-svn-id: http://skia.googlecode.com/svn/trunk@11921 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm')
-rw-r--r-- | gm/clippedbitmapshaders.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/gm/clippedbitmapshaders.cpp b/gm/clippedbitmapshaders.cpp index 02d07bf01e..d7eb3b6e98 100644 --- a/gm/clippedbitmapshaders.cpp +++ b/gm/clippedbitmapshaders.cpp @@ -45,12 +45,13 @@ static const SkScalar SLIDE_SIZE = 300; class ClippedBitmapShadersGM : public GM { public: - ClippedBitmapShadersGM(SkShader::TileMode mode) - : fMode(mode) { + ClippedBitmapShadersGM(SkShader::TileMode mode, bool hq=false) + : fMode(mode), fHQ(hq) { } protected: SkShader::TileMode fMode; + bool fHQ; virtual SkString onShortName() { SkString descriptor; @@ -68,13 +69,16 @@ protected: SkASSERT(false); } descriptor.prepend("clipped-bitmap-shaders-"); + if (fHQ) { + descriptor.append("-hq"); + } return descriptor; } virtual SkISize onISize() { return SkISize::Make(300, 300); } - + virtual void onDraw(SkCanvas* canvas) { SkBitmap bmp = create_bitmap(); SkShader* shader = SkShader::CreateBitmapShader( @@ -87,6 +91,10 @@ protected: s.postTranslate(SLIDE_SIZE / 2, SLIDE_SIZE / 2); shader->setLocalMatrix(s); paint.setShader(shader)->unref(); + + if (fHQ) { + paint.setFilterLevel(SkPaint::kHigh_FilterLevel); + } SkScalar margin = (SLIDE_SIZE / 3 - RECT_SIZE) / 2; for (int i = 0; i < 3; i++) { @@ -115,4 +123,10 @@ private: DEF_GM( return new ClippedBitmapShadersGM(SkShader::kRepeat_TileMode); ) DEF_GM( return new ClippedBitmapShadersGM(SkShader::kMirror_TileMode); ) DEF_GM( return new ClippedBitmapShadersGM(SkShader::kClamp_TileMode); ) + +DEF_GM( return new ClippedBitmapShadersGM(SkShader::kRepeat_TileMode, true); ) +DEF_GM( return new ClippedBitmapShadersGM(SkShader::kMirror_TileMode, true); ) +DEF_GM( return new ClippedBitmapShadersGM(SkShader::kClamp_TileMode, true); ) + + } |