diff options
author | 2012-03-30 18:47:02 +0000 | |
---|---|---|
committer | 2012-03-30 18:47:02 +0000 | |
commit | 198e054b33051a6cd5f606ccbc8d539cefc5631f (patch) | |
tree | a2a05181d0d6b4b8291c2764188c63b2e6aa4a14 /experimental/Intersection/EdgeWalkerPolygon4x4_Test.cpp | |
parent | 06cd732eff09d8f417ced2779e216d6ce6420f59 (diff) |
shape ops work in progress
git-svn-id: http://skia.googlecode.com/svn/trunk@3566 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'experimental/Intersection/EdgeWalkerPolygon4x4_Test.cpp')
-rwxr-xr-x | experimental/Intersection/EdgeWalkerPolygon4x4_Test.cpp | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/experimental/Intersection/EdgeWalkerPolygon4x4_Test.cpp b/experimental/Intersection/EdgeWalkerPolygon4x4_Test.cpp index 27ec5be90f..7054683c53 100755 --- a/experimental/Intersection/EdgeWalkerPolygon4x4_Test.cpp +++ b/experimental/Intersection/EdgeWalkerPolygon4x4_Test.cpp @@ -1,14 +1,24 @@ #include "EdgeWalker_Test.h" #include "Intersection_Tests.h" +#include "SkBitmap.h" +#include "SkCanvas.h" #include <assert.h> #include <pthread.h> - + struct State { + State() { + bitmap.setConfig(SkBitmap::kARGB_8888_Config, 150 * 2, 100); + bitmap.allocPixels(); + canvas = new SkCanvas(bitmap); + } + int a; int b; int c; int d; pthread_t threadID; + SkCanvas* canvas; + SkBitmap bitmap; bool abcIsATriangle; }; @@ -77,13 +87,13 @@ static void* testSimplify4x4QuadralateralsMain(void* data) str += sprintf(str, " path.lineTo(%d, %d);\n", hx, hy); str += sprintf(str, " path.close();"); } - if (!testSimplify(path, true, out)) { + if (!testSimplify(path, true, out, state.bitmap, state.canvas)) { SkDebugf("*/\n{ SkPath::kWinding_FillType, %d, %d, %d, %d," " %d, %d, %d, %d },\n/*\n", state.a, state.b, state.c, state.d, e, f, g, h); } path.setFillType(SkPath::kEvenOdd_FillType); - if (!testSimplify(path, true, out)) { + if (!testSimplify(path, true, out, state.bitmap, state.canvas)) { SkDebugf("*/\n{ SkPath::kEvenOdd_FillType, %d, %d, %d, %d," " %d, %d, %d, %d },\n/*\n", state.a, state.b, state.c, state.d, e, f, g, h); @@ -173,9 +183,9 @@ static void* testSimplify4x4NondegeneratesMain(void* data) { str += sprintf(str, " path.lineTo(%d, %d);\n", fx, fy); str += sprintf(str, " path.close();"); } - testSimplify(path, true, out); + testSimplify(path, true, out, state.bitmap, state.canvas); path.setFillType(SkPath::kEvenOdd_FillType); - testSimplify(path, true, out); + testSimplify(path, true, out, state.bitmap, state.canvas); } } } @@ -263,9 +273,9 @@ static void* testSimplify4x4DegeneratesMain(void* data) { str += sprintf(str, " path.lineTo(%d, %d);\n", fx, fy); str += sprintf(str, " path.close();"); } - testSimplify(path, true, out); + testSimplify(path, true, out, state.bitmap, state.canvas); path.setFillType(SkPath::kEvenOdd_FillType); - testSimplify(path, true, out); + testSimplify(path, true, out, state.bitmap, state.canvas); } } } |