aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMike Reed <reed@google.com>2009-11-20 09:45:43 -0500
committerMike Reed <reed@google.com>2009-11-20 09:45:43 -0500
commit8e048c19870a898cecdde3b3c0d2d512e6f372c0 (patch)
tree06f6268965b3fce2083bf583a455d7ea13c8f28a /tests
parentd3b8e237aaf15dbd5d9790d339688e5f1012f841 (diff)
downloadexternal_skia-8e048c19870a898cecdde3b3c0d2d512e6f372c0.zip
external_skia-8e048c19870a898cecdde3b3c0d2d512e6f372c0.tar.gz
external_skia-8e048c19870a898cecdde3b3c0d2d512e6f372c0.tar.bz2
new edgelist builder that chops segments into clip-sized coordinates, to avoid overflows
The change is conditional at the moment inside SkScan_Path.cpp, USE_NEW_BUILDER. This chopping is meant to only pass in reasonable floats to the edgelist, so that we never overflow when converting to fixed-point. It also has the side-effect of speeding up edges to the left/right of the clip, since those become vertical lines, which are faster to walk over than the original curve segment. Future optimizations: throw away segments to the right of the clip, and tweak the edgelist walker to not require an explicit matching right-edge for the current run.
Diffstat (limited to 'tests')
-rw-r--r--tests/MathTest.cpp8
-rw-r--r--tests/PackBitsTest.cpp4
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/MathTest.cpp b/tests/MathTest.cpp
index dddd2da..09e3748 100644
--- a/tests/MathTest.cpp
+++ b/tests/MathTest.cpp
@@ -235,7 +235,7 @@ static void TestMath(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, clamp == clamp2);
}
- for (i = 0; i < 100000; i++) {
+ for (i = 0; i < 10000; i++) {
SkPoint p;
p.setLength(rand.nextS(), rand.nextS(), SK_Scalar1);
@@ -256,7 +256,7 @@ static void TestMath(skiatest::Reporter* reporter) {
#endif
#ifdef SkLONGLONG
- for (i = 0; i < 100000; i++) {
+ for (i = 0; i < 10000; i++) {
SkFixed numer = rand.nextS();
SkFixed denom = rand.nextS();
SkFixed result = SkFixedDiv(numer, denom);
@@ -321,7 +321,7 @@ static void TestMath(skiatest::Reporter* reporter) {
#endif
#ifdef SK_CAN_USE_FLOAT
- for (i = 0; i < 100000; i++) {
+ for (i = 0; i < 10000; i++) {
SkFract x = rand.nextU() >> 1;
double xx = (double)x / SK_Fract1;
SkFract xr = SkFractSqrt(x);
@@ -351,7 +351,7 @@ static void TestMath(skiatest::Reporter* reporter) {
}
int maxDiff = 0;
- for (i = 0; i < 10000; i++) {
+ for (i = 0; i < 1000; i++) {
SkFixed rads = rand.nextS() >> 10;
double frads = SkFixedToFloat(rads);
diff --git a/tests/PackBitsTest.cpp b/tests/PackBitsTest.cpp
index 729467e..a22590c 100644
--- a/tests/PackBitsTest.cpp
+++ b/tests/PackBitsTest.cpp
@@ -90,7 +90,7 @@ static void test_pack8(skiatest::Reporter* reporter) {
}
for (size_t size = 1; size <= 512; size += 1) {
- for (int n = 200; n; n--) {
+ for (int n = 100; n; n--) {
uint8_t src[600], src2[600];
uint8_t dst[600];
rand_fill(src, size);
@@ -104,7 +104,7 @@ static void test_pack8(skiatest::Reporter* reporter) {
bool match = memcmp(src, src2, size * sizeof(uint8_t)) == 0;
REPORTER_ASSERT(reporter, match);
- for (int j = 0; j < 200; j++) {
+ for (int j = 0; j < 100; j++) {
size_t skip = gRand.nextU() % size;
size_t write = gRand.nextU() % size;
if (skip + write > size) {