diff options
author | reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2010-01-25 22:02:44 +0000 |
---|---|---|
committer | reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2010-01-25 22:02:44 +0000 |
commit | 04d86c6a6b8eb8631752b3680f1292fa0a2c7119 (patch) | |
tree | a4fde9cb4788c9fae4a1e9ccca6f09f146d3d2c0 /samplecode/SampleStrokePath.cpp | |
parent | b8fd84b803b2a2f4d304e0763b83a90f582b449a (diff) |
update to try out programmable shaders
git-svn-id: http://skia.googlecode.com/svn/trunk@478 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'samplecode/SampleStrokePath.cpp')
-rw-r--r-- | samplecode/SampleStrokePath.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/samplecode/SampleStrokePath.cpp b/samplecode/SampleStrokePath.cpp index 6808556dec..e7914dbe30 100644 --- a/samplecode/SampleStrokePath.cpp +++ b/samplecode/SampleStrokePath.cpp @@ -7,6 +7,32 @@ #include "SkBlurMaskFilter.h" +static void test_huge_stroke(SkCanvas* canvas) { + SkRect srcR = { 0, 0, 72000, 54000 }; + SkRect dstR = { 0, 0, 640, 480 }; + + SkPath path; + path.moveTo(17600, 8000); + path.lineTo(52800, 8000); + path.lineTo(52800, 41600); + path.lineTo(17600, 41600); + path.close(); + + SkPaint paint; + paint.setAntiAlias(true); + paint.setStrokeWidth(8000); + paint.setStrokeMiter(10); + paint.setStrokeCap(SkPaint::kButt_Cap); + paint.setStrokeJoin(SkPaint::kRound_Join); + paint.setStyle(SkPaint::kStroke_Style); + + SkMatrix matrix; + matrix.setRectToRect(srcR, dstR, SkMatrix::kCenter_ScaleToFit); + canvas->concat(matrix); + + canvas->drawPath(path, paint); +} + #if 0 #include "SkBlurMask.h" static void test_blur() { @@ -118,6 +144,7 @@ protected: virtual void onDraw(SkCanvas* canvas) { drawBG(canvas); //return; + test_huge_stroke(canvas); return; canvas->translate(SkIntToScalar(10), SkIntToScalar(10)); SkPaint paint; |