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

Unified Diff: remoting/android/java/src/org/chromium/chromoting/GlDesktopView.java

Issue 2175353003: [Remoting Android] Define feedback animation size in dp (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Set up radius inside AbstractDesktopView Created 4 years, 5 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: remoting/android/java/src/org/chromium/chromoting/GlDesktopView.java
diff --git a/remoting/android/java/src/org/chromium/chromoting/GlDesktopView.java b/remoting/android/java/src/org/chromium/chromoting/GlDesktopView.java
index 439eeab6d21644f38faa9a2f30daa45bccf665a7..7953ea057203e05ec02d81977e806175c0555432 100644
--- a/remoting/android/java/src/org/chromium/chromoting/GlDesktopView.java
+++ b/remoting/android/java/src/org/chromium/chromoting/GlDesktopView.java
@@ -29,22 +29,12 @@ public class GlDesktopView extends AbstractDesktopView implements SurfaceHolder.
}
@Override
- public void showInputFeedback(InputFeedbackType feedbackToShow, Point pos) {
- float diameter;
- // TODO(yuweih): diameter (and radius in DesktopView) should be defined in dp so that it is
- // DPI independent.
- switch (feedbackToShow) {
- case LARGE_ANIMATION:
- diameter = 320.f;
- break;
- case SMALL_ANIMATION:
- diameter = 80.f;
- break;
- default:
- return;
- }
+ public void showInputFeedback(float feedbackRadius, Point pos) {
+ // Note that the OpenGL renderer takes diameter as argument so the radius we got needs
+ // to be multiplied by 2.
joedow 2016/07/26 03:03:24 You could remove the comment and just add a var: f
Yuwei 2016/07/26 18:47:26 Done.
+
float scaleFactor = mRenderData.transform.mapRadius(1);
- mDisplay.showCursorInputFeedback(pos.x, pos.y, diameter / scaleFactor);
+ mDisplay.showCursorInputFeedback(pos.x, pos.y, 2 * feedbackRadius / scaleFactor);
}
@Override

Powered by Google App Engine
This is Rietveld 408576698