#include <pthread.h>
-#define WIDTH 200
+#define WIDTH 160
#define HEIGHT 200
static bool gDone;
SkRect oval;
oval.setEmpty();
+ SkRect clipR = SkRect::MakeWH(SkIntToScalar(bm->width()), SkIntToScalar(bm->height()));
+ clipR.inset(SK_Scalar1/4, SK_Scalar1/4);
+
while (!gDone) {
ref->inval(oval, true);
oval.set(x, y, x + SkIntToScalar(OVALW), y + SkIntToScalar(OVALH));
// this must be local to the loop, since it needs to forget the pixels
// its writing to after each iteration, since we do the swap
SkCanvas canvas(update.bitmap());
+ canvas.clipRect(clipR, SkRegion::kIntersect_Op, true);
-// SkDebugf("----- dirty [%d %d %d %d]\n", dirty.getBounds().fLeft, dirty.getBounds().fTop, dirty.getBounds().width(), dirty.getBounds().height());
canvas.clipRegion(update.dirty());
canvas.drawColor(0, SkXfermode::kClear_Mode);
}
bounce(&x, &dx, WIDTH-OVALW);
bounce(&y, &dy, HEIGHT-OVALH);
-
-#if 1
- for (int i = 0; i < 1000; i++) {
- for (int j = 0; j < 10000; j++) {
- SkFixedMul(j, 10);
- }
- }
-#endif
}
return NULL;
}
static const SkBitmap::Config gConfigs[] = {
SkBitmap::kARGB_8888_Config,
-#if 1
SkBitmap::kRGB_565_Config,
SkBitmap::kARGB_4444_Config,
SkBitmap::kA8_Config
-#endif
};
class PageFlipView : public SampleView {