add init() method, so we don't draw in our constructor (makes debugging harder)



git-svn-id: http://skia.googlecode.com/svn/trunk@3368 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/samplecode/SampleXfermodes.cpp b/samplecode/SampleXfermodes.cpp
index ffea954..4ad967e 100644
--- a/samplecode/SampleXfermodes.cpp
+++ b/samplecode/SampleXfermodes.cpp
@@ -134,7 +134,18 @@
 public:
     const static int W = 64;
     const static int H = 64;
+    bool fOnce;
+
 	XfermodesView() {
+        fOnce = false;
+    }
+    
+    void init() {
+        if (fOnce) {
+            return;
+        }
+        fOnce = true;
+
         const int W = 64;
         const int H = 64;
 
@@ -156,6 +167,8 @@
     }
 
     virtual void onDrawContent(SkCanvas* canvas) {
+        this->init();
+
         canvas->translate(SkIntToScalar(10), SkIntToScalar(20));
 
         const struct {