delay any drawing until first call to onDraw (eases debugging)
git-svn-id: http://skia.googlecode.com/svn/trunk@3461 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gm/bitmapscroll.cpp b/gm/bitmapscroll.cpp
index 70d1052..eee9668 100644
--- a/gm/bitmapscroll.cpp
+++ b/gm/bitmapscroll.cpp
@@ -45,10 +45,19 @@
}
class BitmapScrollGM : public GM {
-public:
- BitmapScrollGM() {
+ bool fInited;
+ void init() {
+ if (fInited) {
+ return;
+ }
+ fInited = true;
// Create the original bitmap.
make_bitmap(quarterWidth, quarterHeight, &origBitmap);
+ }
+
+public:
+ BitmapScrollGM() {
+ fInited = false;
this->setBGColor(0xFFDDDDDD);
}
@@ -62,6 +71,7 @@
}
virtual void onDraw(SkCanvas* canvas) {
+ this->init();
SkIRect scrollCenterRegion = SkIRect::MakeXYWH(
quarterWidth, quarterHeight, quarterWidth*2+1, quarterHeight*2+1);
int x = quarterWidth;