diff options
| author | Bryce Harrington <b.harrington@samsung.com> | 2014-06-12 16:13:56 -0700 |
|---|---|---|
| committer | Bryce Harrington <b.harrington@samsung.com> | 2014-06-12 16:15:30 -0700 |
| commit | 38445469fcc76ecb8d27b87c30ac4ed9d35ead43 (patch) | |
| tree | 4f2911e4a5c5ebbc5b18f84ccb5f900583cc7376 /src/skia-tests/image.cpp | |
| parent | 71fa56a1c42dc0e0c2c3620ee743d096d6dc0143 (diff) | |
Add image tests
Diffstat (limited to 'src/skia-tests/image.cpp')
| -rw-r--r-- | src/skia-tests/image.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/skia-tests/image.cpp b/src/skia-tests/image.cpp index d681f90..f60763a 100644 --- a/src/skia-tests/image.cpp +++ b/src/skia-tests/image.cpp @@ -55,11 +55,17 @@ sk_teardown_image(void) int sk_test_image(caskbench_context_t *ctx) { - int i, x, y; + int w = ctx->canvas_width; + int h = ctx->canvas_height; + int iw = bitmap.width(); + int ih = bitmap.height(); + int pw = w - iw; + int ph = h - ih; + + for (int i=0; i<ctx->size; i++) { + double x = (double)rand()/RAND_MAX * pw; + double y = (double)rand()/RAND_MAX * ph; - for (i=0; i<ctx->size; i++) { - y = 50 * (int)(i/4); - x = 200 * (i%4); ctx->skia_canvas->drawBitmap(bitmap, x, y); } |