aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode/SampleAndroidShadows.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'samplecode/SampleAndroidShadows.cpp')
-rw-r--r--samplecode/SampleAndroidShadows.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/samplecode/SampleAndroidShadows.cpp b/samplecode/SampleAndroidShadows.cpp
index 0e0a4b4a79..803ea49f4a 100644
--- a/samplecode/SampleAndroidShadows.cpp
+++ b/samplecode/SampleAndroidShadows.cpp
@@ -70,32 +70,43 @@ protected:
SkUnichar uni;
if (SampleCode::CharQ(*evt, &uni)) {
+ bool handled = false;
switch (uni) {
case 'W':
fShowAmbient = !fShowAmbient;
+ handled = true;
break;
case 'S':
fShowSpot = !fShowSpot;
+ handled = true;
break;
case 'T':
fUseAlt = !fUseAlt;
+ handled = true;
break;
case 'O':
fShowObject = !fShowObject;
+ handled = true;
break;
case '>':
fZDelta += 0.5f;
+ handled = true;
break;
case '<':
fZDelta -= 0.5f;
+ handled = true;
break;
case '?':
fIgnoreShadowAlpha = !fIgnoreShadowAlpha;
+ handled = true;
break;
default:
break;
}
- this->inval(nullptr);
+ if (handled) {
+ this->inval(nullptr);
+ return true;
+ }
}
return this->INHERITED::onQuery(evt);
}
@@ -503,7 +514,7 @@ protected:
}
private:
- typedef SkView INHERITED;
+ typedef SampleView INHERITED;
};
//////////////////////////////////////////////////////////////////////////////