aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode/SampleComplexClip.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-03-10 19:20:15 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-03-10 19:20:15 +0000
commit807cec4397cb50a64de7355ae129cc7c8f2c772b (patch)
tree0ee15adcb2e5e0eb0dd2063e933107295aed3c62 /samplecode/SampleComplexClip.cpp
parent498a623e2eacb709c23e5c5be6d4991ad83ab167 (diff)
Add complex clip gm sample and cleanup unused headers/code in SampleComplexClip
git-svn-id: http://skia.googlecode.com/svn/trunk@919 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'samplecode/SampleComplexClip.cpp')
-rw-r--r--samplecode/SampleComplexClip.cpp28
1 files changed, 1 insertions, 27 deletions
diff --git a/samplecode/SampleComplexClip.cpp b/samplecode/SampleComplexClip.cpp
index 8aee1bfb6a..c7c4896d02 100644
--- a/samplecode/SampleComplexClip.cpp
+++ b/samplecode/SampleComplexClip.cpp
@@ -1,34 +1,9 @@
#include "SampleCode.h"
#include "SkCanvas.h"
-#include "SkParsePath.h"
#include "SkPath.h"
-#include "SkRandom.h"
#include "SkView.h"
-static void scale_to_width(SkPath* path, SkScalar dstWidth) {
- const SkRect& bounds = path->getBounds();
- SkScalar scale = dstWidth / bounds.width();
- SkMatrix matrix;
-
- matrix.setScale(scale, scale);
- path->transform(matrix);
-}
-
-static const struct {
- SkPaint::Style fStyle;
- SkPaint::Join fJoin;
- int fStrokeWidth;
-} gRec[] = {
- { SkPaint::kFill_Style, SkPaint::kMiter_Join, 0 },
- { SkPaint::kStroke_Style, SkPaint::kMiter_Join, 0 },
- { SkPaint::kStroke_Style, SkPaint::kMiter_Join, 10 },
- { SkPaint::kStrokeAndFill_Style, SkPaint::kMiter_Join, 10 },
-};
-
-#define TEST_INVERSE 1
-
class ComplexClipView : public SkView {
- SkScalar fWidth;
public:
ComplexClipView() {
}
@@ -116,8 +91,7 @@ protected:
canvas->scale(3 * SK_Scalar1 / 4, 3 * SK_Scalar1 / 4);
canvas->save();
- int invALimit = TEST_INVERSE ? 2 : 1;
- for (int invA = 0; invA < invALimit; ++invA) {
+ for (int invA = 0; invA < 2; ++invA) {
for (int op = 0; op < SK_ARRAY_COUNT(gOps); ++op) {
int idx = invA * SK_ARRAY_COUNT(gOps) + op;
if (!(idx % 3)) {