summaryrefslogtreecommitdiff
path: root/android/widget/Magnifier.java
diff options
context:
space:
mode:
authorJustin Klaassen <justinklaassen@google.com>2018-04-15 00:41:15 -0400
committerJustin Klaassen <justinklaassen@google.com>2018-04-15 00:41:15 -0400
commitb8042fc9b036db0a6692ca853428fc6ab1e60892 (patch)
tree82669ea5d75238758e22d379a42baeada526219e /android/widget/Magnifier.java
parent4d01eeaffaa720e4458a118baa137a11614f00f7 (diff)
downloadandroid-28-b8042fc9b036db0a6692ca853428fc6ab1e60892.tar.gz
/google/data/ro/projects/android/fetch_artifact \ --bid 4719250 \ --target sdk_phone_armv7-win_sdk \ sdk-repo-linux-sources-4719250.zip AndroidVersion.ApiLevel has been modified to appear as 28 Change-Id: I9ec0a12c9251b8449dba0d86b0cfdbcca16b0a7c
Diffstat (limited to 'android/widget/Magnifier.java')
-rw-r--r--android/widget/Magnifier.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/android/widget/Magnifier.java b/android/widget/Magnifier.java
index 5eb66999..cb362e65 100644
--- a/android/widget/Magnifier.java
+++ b/android/widget/Magnifier.java
@@ -233,6 +233,17 @@ public final class Magnifier {
return mZoom;
}
+ /**
+ * @hide
+ */
+ @Nullable
+ public Point getWindowCoords() {
+ if (mWindow == null) {
+ return null;
+ }
+ return new Point(mWindow.mLastDrawContentPositionX, mWindow.mLastDrawContentPositionY);
+ }
+
@Nullable
private Surface getValidViewSurface() {
// TODO: deduplicate this against the first part of #performPixelCopy
@@ -374,8 +385,11 @@ public final class Magnifier {
private final Runnable mMagnifierUpdater;
// The handler where the magnifier updater jobs will be post'd.
private final Handler mHandler;
- // The callback to be run after the next draw. Only used for testing.
+ // The callback to be run after the next draw.
private Callback mCallback;
+ // The position of the magnifier content when the last draw was requested.
+ private int mLastDrawContentPositionX;
+ private int mLastDrawContentPositionY;
// Members below describe the state of the magnifier. Reads/writes to them
// have to be synchronized between the UI thread and the thread that handles
@@ -598,6 +612,8 @@ public final class Magnifier {
callback = null;
}
+ mLastDrawContentPositionX = mWindowPositionX + mOffsetX;
+ mLastDrawContentPositionY = mWindowPositionY + mOffsetY;
mFrameDrawScheduled = false;
}