aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/strokefill.cpp
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-01-11 18:16:39 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-01-11 18:16:39 +0000
commit3d19c385e7c0bdd94171bf4892b991b77880c5ed (patch)
tree37b03fc7a4cbdb0ef8f07879ec825c64f13ba6f8 /gm/strokefill.cpp
parentb9349e1cb5a0fedcb7ee7a2fd3c6585b5302bfe8 (diff)
fix cheapComputeDirection() in the non-convex case to pivot on the y-max point
rather than pivoting on the next. Also remove the loop, as it is just logically wrong to think we can use this trick only a non-extrema pt. git-svn-id: http://skia.googlecode.com/svn/trunk@3014 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm/strokefill.cpp')
-rw-r--r--gm/strokefill.cpp54
1 files changed, 2 insertions, 52 deletions
diff --git a/gm/strokefill.cpp b/gm/strokefill.cpp
index 193e850580..a37af806f4 100644
--- a/gm/strokefill.cpp
+++ b/gm/strokefill.cpp
@@ -10,56 +10,6 @@
#include "SkPath.h"
#include "SkTypeface.h"
-static void test_path(SkCanvas* canvas, const SkPath& path) {
- SkPaint paint;
- paint.setAntiAlias(true);
- canvas->drawPath(path, paint);
-
- paint.setStyle(SkPaint::kStroke_Style);
- paint.setColor(SK_ColorRED);
- canvas->drawPath(path, paint);
-}
-
-static void test_rev(SkCanvas* canvas, const SkPath& path) {
- test_path(canvas, path);
-
- SkPath rev;
- rev.reverseAddPath(path);
- canvas->save();
- canvas->translate(SkIntToScalar(150), 0);
- test_path(canvas, rev);
- canvas->restore();
-}
-
-static void test_rev(SkCanvas* canvas) {
- SkRect r = { 10, 10, 100, 60 };
-
- SkPath path;
-
- path.addRect(r); test_rev(canvas, path);
-
- canvas->translate(0, 100);
- path.offset(20, 20);
- path.addRect(r); test_rev(canvas, path);
-
- canvas->translate(0, 100);
- path.reset();
- path.moveTo(10, 10); path.lineTo(30, 30);
- path.addOval(r);
- r.offset(50, 20);
- path.addOval(r);
- test_rev(canvas, path);
-
- SkPaint paint;
- paint.setTextSize(SkIntToScalar(100));
- SkTypeface* hira = SkTypeface::CreateFromName("Hiragino Maru Gothic Pro", SkTypeface::kNormal);
- SkSafeUnref(paint.setTypeface(hira));
- path.reset();
- paint.getTextPath("e", 1, 50, 50, &path);
- canvas->translate(0, 100);
- test_rev(canvas, path);
-}
-
namespace skiagm {
class StrokeFillGM : public GM {
@@ -83,8 +33,8 @@ protected:
const size_t len = sizeof(text) - 1;
paint.setAntiAlias(true);
paint.setTextSize(SkIntToScalar(100));
- SkTypeface* hira = SkTypeface::CreateFromName("Hiragino Maru Gothic Pro",
- SkTypeface::kNormal);
+// SkTypeface* hira = SkTypeface::CreateFromName("Hiragino Maru Gothic Pro", SkTypeface::kNormal);
+ SkTypeface* hira = SkTypeface::CreateFromName("Papyrus", SkTypeface::kNormal);
paint.setTypeface(hira);
SkScalar x = SkIntToScalar(180);
SkScalar y = SkIntToScalar(88);