retool SkEvent to own its target ID or target proc



git-svn-id: http://skia.googlecode.com/svn/trunk@2041 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index 0d70f66..92004f9 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -156,8 +156,7 @@
 static const char view_inval_msg[] = "view-inval-msg";
 
 void SampleWindow::postInvalDelay() {
-    SkEvent* evt = new SkEvent(view_inval_msg);
-    evt->post(this->getSinkID(), 1);
+    (new SkEvent(view_inval_msg, this->getSinkID()))->postDelay(1);
 }
 
 static bool isInvalEvent(const SkEvent& evt) {
@@ -1002,8 +1001,7 @@
 
 void SampleWindow::postAnimatingEvent() {
     if (fAnimating) {
-        SkEvent* evt = new SkEvent(ANIMATING_EVENTTYPE);
-        evt->post(this->getSinkID(), ANIMATING_DELAY);
+        (new SkEvent(ANIMATING_EVENTTYPE, this->getSinkID()))->postDelay(ANIMATING_DELAY);
     }
 }
 
@@ -1416,6 +1414,7 @@
     if (NULL == view) {
         view = create_overview(fSamples.count(), fSamples.begin());
     }
+    
     view->setVisibleP(true);
     view->setClipToBounds(false);
     this->attachChildToFront(view)->unref();
diff --git a/samplecode/SampleGM.cpp b/samplecode/SampleGM.cpp
index 7319af8..2d172af 100644
--- a/samplecode/SampleGM.cpp
+++ b/samplecode/SampleGM.cpp
@@ -96,7 +96,7 @@
     
 private:
     void postNextGM() {
-        (new SkEvent("next-gm"))->post(this->getSinkID(), 1500);
+        (new SkEvent("next-gm", this->getSinkID()))->postDelay(1500);
     }
 
     typedef SampleView INHERITED;
diff --git a/samplecode/SamplePicture.cpp b/samplecode/SamplePicture.cpp
index d0ec092..d2c9d65 100644
--- a/samplecode/SamplePicture.cpp
+++ b/samplecode/SamplePicture.cpp
@@ -173,7 +173,7 @@
     #define INVAL_ALL_TYPE  "inval-all"
     
     void delayInval(SkMSec delay) {
-        (new SkEvent(INVAL_ALL_TYPE))->post(this->getSinkID(), delay);
+        (new SkEvent(INVAL_ALL_TYPE, this->getSinkID()))->postDelay(delay);
     }
     
     virtual bool onEvent(const SkEvent& evt) {
diff --git a/samplecode/SampleXfermodesBlur.cpp b/samplecode/SampleXfermodesBlur.cpp
index c1aaf98..f0dcf31 100644
--- a/samplecode/SampleXfermodesBlur.cpp
+++ b/samplecode/SampleXfermodesBlur.cpp
@@ -95,6 +95,30 @@
     virtual void onDrawContent(SkCanvas* canvas) {
         canvas->translate(SkIntToScalar(10), SkIntToScalar(20));
 
+        if (false) {
+            SkPaint paint;
+            paint.setAntiAlias(true);
+            paint.setTextSize(50);
+            paint.setTypeface(SkTypeface::CreateFromName("Arial Unicode MS", SkTypeface::kNormal));
+            SkSafeUnref(paint.getTypeface());
+            char buffer[10];
+            size_t len = SkUTF8_FromUnichar(0x8500, buffer);
+            canvas->drawText(buffer, len, 40, 40, paint);
+            return;
+        }
+        if (true) {
+            SkPaint paint;
+            paint.setAntiAlias(true);
+            
+            SkRect r0 = { 0, 0, 10.5f, 20 };
+            SkRect r1 = { 10.5f, 10, 20, 30 };
+            paint.setColor(SK_ColorRED);
+            canvas->drawRect(r0, paint);
+            paint.setColor(SK_ColorBLUE);
+            canvas->drawRect(r1, paint);
+            return;
+        }
+
         const struct {
             SkXfermode::Mode  fMode;
             const char*         fLabel;