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

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

Issue 2255663002: [Remoting Android] Use floating point coords for rendering the cursor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/RenderData.java
diff --git a/remoting/android/java/src/org/chromium/chromoting/RenderData.java b/remoting/android/java/src/org/chromium/chromoting/RenderData.java
index 8e21488f30199551395da036f62673419f57de8a..a548f53906c83fe2a3402d2b3619112643a0eee8 100644
--- a/remoting/android/java/src/org/chromium/chromoting/RenderData.java
+++ b/remoting/android/java/src/org/chromium/chromoting/RenderData.java
@@ -6,6 +6,7 @@ package org.chromium.chromoting;
import android.graphics.Matrix;
import android.graphics.Point;
+import android.graphics.PointF;
/**
* This class stores data that needs to be accessed on both the display thread and the
@@ -27,15 +28,24 @@ public class RenderData {
* Specifies the position, in image coordinates, at which the cursor image will be drawn.
* This will normally be at the location of the most recently injected motion event.
*/
- private Point mCursorPosition = new Point();
+ private PointF mCursorPosition = new PointF();
/**
* Returns the position of the rendered cursor.
*
* @return A point representing the current position.
*/
- public Point getCursorPosition() {
- return new Point(mCursorPosition);
+ public PointF getCursorPosition() {
+ return new PointF(mCursorPosition.x, mCursorPosition.y);
+ }
+
+ /**
+ * Returns the position of the rendered cursor. The values are casted to integer.
+ *
+ * @return A point representing the current position.
+ */
+ public Point getIntegerCursorPosition() {
+ return new Point((int) mCursorPosition.x, (int) mCursorPosition.y);
}
/**
@@ -45,7 +55,7 @@ public class RenderData {
* @param newY The new value of the y coordinate
* @return True if the cursor position has changed.
*/
- public boolean setCursorPosition(int newX, int newY) {
+ public boolean setCursorPosition(float newX, float newY) {
boolean cursorMoved = false;
if (newX != mCursorPosition.x) {
mCursorPosition.x = newX;

Powered by Google App Engine
This is Rietveld 408576698