aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/imageblur.cpp
diff options
context:
space:
mode:
authorGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-11-16 18:20:47 +0000
committerGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-11-16 18:20:47 +0000
commit54e01b2ab985e7a7d38109812069d056d128bfa1 (patch)
tree7ab3dab321f57145e25033ad24b59c9c3f806fdc /gm/imageblur.cpp
parentda957724d2a1fe97113f1464740d1fe76c1bb077 (diff)
This change makes SkImageFilter and SkBlurImageFilter flattenable/unflattenable.
The imageblur test also needed to stop calling getDeviceSize(), since it was returning 99999x99999 for the SkPicture case. git-svn-id: http://skia.googlecode.com/svn/trunk@2699 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm/imageblur.cpp')
-rw-r--r--gm/imageblur.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/gm/imageblur.cpp b/gm/imageblur.cpp
index fe9d6c29ac..841441e68d 100644
--- a/gm/imageblur.cpp
+++ b/gm/imageblur.cpp
@@ -8,6 +8,9 @@
#include "gm.h"
#include "SkBlurImageFilter.h"
+#define WIDTH 500
+#define HEIGHT 500
+
namespace skiagm {
class ImageBlurGM : public GM {
@@ -22,22 +25,19 @@ protected:
}
virtual SkISize onISize() {
- return make_isize(500, 500);
+ return make_isize(WIDTH, HEIGHT);
}
virtual void onDraw(SkCanvas* canvas) {
SkPaint paint;
paint.setImageFilter(new SkBlurImageFilter(24.0f, 0.0f))->unref();
canvas->saveLayer(NULL, &paint);
- paint.setColor(0xFFFFFFFF);
- paint.setTextSize(100);
paint.setAntiAlias(true);
const char* str = "The quick brown fox jumped over the lazy dog.";
srand(1234);
- SkISize size = canvas->getDeviceSize();
for (int i = 0; i < 25; ++i) {
- int x = rand() % size.fWidth;
- int y = rand() % size.fHeight;
+ int x = rand() % WIDTH;
+ int y = rand() % HEIGHT;
paint.setColor(rand() % 0x1000000 | 0xFF000000);
paint.setTextSize(rand() % 300);
canvas->drawText(str, strlen(str), x, y, paint);