Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(536)

Unified Diff: tools/viewer/Viewer.cpp

Issue 1982643004: Implement touch control (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Revision Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/viewer/Viewer.cpp
diff --git a/tools/viewer/Viewer.cpp b/tools/viewer/Viewer.cpp
index 7dd265e6e2183cd75c4e726410be8a845aa12d41..c8b6aef15b719da6805bd7799210f9999ff59577 100644
--- a/tools/viewer/Viewer.cpp
+++ b/tools/viewer/Viewer.cpp
@@ -224,10 +224,8 @@ void Viewer::updateMatrix(){
m.postTranslate(cx, cy);
}
- // TODO: add gesture support
- // Apply any gesture matrix
- //m.preConcat(fGesture.localM());
- //m.preConcat(fGesture.globalM());
+ m.preConcat(fWindow->getGestureLocalM());
+ m.preConcat(fWindow->getGestureGlobalM());
fLocalMatrix = m;
}
@@ -260,6 +258,9 @@ void Viewer::onPaint(SkCanvas* canvas) {
drawStats(canvas);
}
fCommands.drawHelp(canvas);
+
+ // Update the matrix to reflect touch/click zoom or move
+ updateMatrix();
djsollen 2016/05/16 19:09:03 shouldn't this update happen as a reponse to touch
liyuqian 2016/05/16 20:34:55 Done.
}
void Viewer::drawStats(SkCanvas* canvas) {
« no previous file with comments | « platform_tools/android/apps/viewer/src/main/java/org/skia/viewer/ViewerActivity.java ('k') | tools/viewer/sk_app/Window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698