sk_app, Sample: Unify InputState enum.
replace() {
if git grep -q "$1")";
then sed -i -e "s#${1}#${2}#g" $(git grep -l "$1");
fi
}
replace 'k\([A-Za-z]*\)_InputState' 'InputState::k\1'
replace '\(\(sk_app::\|\)Window\|Sample\|\)::InputState' 'InputState'
Change-Id: I4cc18814fb1fbdd1f240aabba05aae79c54a4841
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227642
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
diff --git a/tools/viewer/ParticlesSlide.cpp b/tools/viewer/ParticlesSlide.cpp
index 64a748a..9943e9b 100644
--- a/tools/viewer/ParticlesSlide.cpp
+++ b/tools/viewer/ParticlesSlide.cpp
@@ -347,9 +347,9 @@
return true;
}
-bool ParticlesSlide::onMouse(SkScalar x, SkScalar y, Window::InputState state, ModifierKey modifiers) {
+bool ParticlesSlide::onMouse(SkScalar x, SkScalar y, InputState state, ModifierKey modifiers) {
if (gDragIndex == -1) {
- if (state == Window::kDown_InputState) {
+ if (state == InputState::kDown) {
float bestDistance = kDragSize;
SkPoint mousePt = { x, y };
for (int i = 0; i < gDragPoints.count(); ++i) {
@@ -365,7 +365,7 @@
// Currently dragging
SkASSERT(gDragIndex < gDragPoints.count());
gDragPoints[gDragIndex]->set(x, y);
- if (state == Window::kUp_InputState) {
+ if (state == InputState::kUp) {
gDragIndex = -1;
}
return true;