aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode
diff options
context:
space:
mode:
Diffstat (limited to 'samplecode')
-rw-r--r--samplecode/SampleApp.cpp7
-rw-r--r--samplecode/SampleGM.cpp2
-rw-r--r--samplecode/SamplePicture.cpp2
-rw-r--r--samplecode/SampleXfermodesBlur.cpp24
4 files changed, 29 insertions, 6 deletions
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index 0d70f660df..92004f9e31 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -156,8 +156,7 @@ private:
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 @@ int SampleWindow::sampleCount() {
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 @@ void SampleWindow::loadView(SkView* view) {
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 7319af8aa3..2d172af3dc 100644
--- a/samplecode/SampleGM.cpp
+++ b/samplecode/SampleGM.cpp
@@ -96,7 +96,7 @@ protected:
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 d0ec092942..d2c9d659cc 100644
--- a/samplecode/SamplePicture.cpp
+++ b/samplecode/SamplePicture.cpp
@@ -173,7 +173,7 @@ private:
#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 c1aaf98e33..f0dcf312ab 100644
--- a/samplecode/SampleXfermodesBlur.cpp
+++ b/samplecode/SampleXfermodesBlur.cpp
@@ -95,6 +95,30 @@ protected:
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;