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

Side by Side Diff: remoting/android/java/src/org/chromium/chromoting/InputFeedbackRadiusMapper.java

Issue 2282783003: [Remoting Android] Create Interfaces for GlDisplay (Closed)
Patch Set: Merge ToT again Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chromoting; 5 package org.chromium.chromoting;
6 6
7 import android.view.View; 7 import android.view.View;
8 8
9 /** 9 /**
10 * Helper class for mapping a feedback type to the max radius of the feedback an imation circle. 10 * Helper class for mapping a feedback type to the max radius of the feedback an imation circle.
(...skipping 13 matching lines...) Expand all
24 mLargeFeedbackPixelRadius = view.getResources() 24 mLargeFeedbackPixelRadius = view.getResources()
25 .getDimensionPixelSize(R.dimen.feedback_animation_radius_large); 25 .getDimensionPixelSize(R.dimen.feedback_animation_radius_large);
26 } 26 }
27 27
28 /** 28 /**
29 * @param feedbackToShow the feedback type to be mapped to the radius of the feedback circle. 29 * @param feedbackToShow the feedback type to be mapped to the radius of the feedback circle.
30 * @param scaleFactor Current scale factor of the desktop canvas. 30 * @param scaleFactor Current scale factor of the desktop canvas.
31 * @return the radius of the given feedback type. It may be 0, in which case nothing needs to 31 * @return the radius of the given feedback type. It may be 0, in which case nothing needs to
32 * be shown. 32 * be shown.
33 */ 33 */
34 public float getFeedbackRadius(DesktopView.InputFeedbackType feedbackToShow, 34 public float getFeedbackRadius(RenderStub.InputFeedbackType feedbackToShow,
35 float scaleFactor) { 35 float scaleFactor) {
36 switch (feedbackToShow) { 36 switch (feedbackToShow) {
37 case NONE: 37 case NONE:
38 return 0.0f; 38 return 0.0f;
39 case SHORT_TOUCH_ANIMATION: 39 case SHORT_TOUCH_ANIMATION:
40 return mSmallFeedbackPixelRadius / scaleFactor; 40 return mSmallFeedbackPixelRadius / scaleFactor;
41 case LONG_TOUCH_ANIMATION: 41 case LONG_TOUCH_ANIMATION:
42 return mLargeFeedbackPixelRadius / scaleFactor; 42 return mLargeFeedbackPixelRadius / scaleFactor;
43 case LONG_TRACKPAD_ANIMATION: 43 case LONG_TRACKPAD_ANIMATION:
44 // The size of the longpress trackpad animation is supposed to b e close to the 44 // The size of the longpress trackpad animation is supposed to b e close to the
45 // size of the cursor so it doesn't need to be normalized and sh ould be scaled 45 // size of the cursor so it doesn't need to be normalized and sh ould be scaled
46 // with the canvas. 46 // with the canvas.
47 return mTinyFeedbackPixelRadius; 47 return mTinyFeedbackPixelRadius;
48 default: 48 default:
49 // Unreachable, but required by Google Java style and findbugs. 49 // Unreachable, but required by Google Java style and findbugs.
50 assert false : "Unreached"; 50 assert false : "Unreached";
51 return 0.0f; 51 return 0.0f;
52 } 52 }
53 } 53 }
54 } 54 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698