summaryrefslogtreecommitdiffstats
path: root/services/java/com/android/server/display/DisplayDevice.java
diff options
context:
space:
mode:
Diffstat (limited to 'services/java/com/android/server/display/DisplayDevice.java')
-rw-r--r--services/java/com/android/server/display/DisplayDevice.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/services/java/com/android/server/display/DisplayDevice.java b/services/java/com/android/server/display/DisplayDevice.java
index 995c553..8eeefb4 100644
--- a/services/java/com/android/server/display/DisplayDevice.java
+++ b/services/java/com/android/server/display/DisplayDevice.java
@@ -132,14 +132,17 @@ abstract class DisplayDevice {
|| mCurrentDisplayRect == null
|| !mCurrentDisplayRect.equals(displayRect)) {
mCurrentOrientation = orientation;
+
if (mCurrentLayerStackRect == null) {
mCurrentLayerStackRect = new Rect();
}
mCurrentLayerStackRect.set(layerStackRect);
+
if (mCurrentDisplayRect == null) {
mCurrentDisplayRect = new Rect();
}
mCurrentDisplayRect.set(displayRect);
+
Surface.setDisplayProjection(mDisplayToken,
orientation, layerStackRect, displayRect);
}
@@ -156,6 +159,26 @@ abstract class DisplayDevice {
}
/**
+ * Populates the specified viewport object with orientation,
+ * physical and logical rects based on the display's current projection.
+ */
+ public final void populateViewportLocked(DisplayViewport viewport) {
+ viewport.orientation = mCurrentOrientation;
+
+ if (mCurrentLayerStackRect != null) {
+ viewport.logicalFrame.set(mCurrentLayerStackRect);
+ } else {
+ viewport.logicalFrame.setEmpty();
+ }
+
+ if (mCurrentDisplayRect != null) {
+ viewport.physicalFrame.set(mCurrentDisplayRect);
+ } else {
+ viewport.physicalFrame.setEmpty();
+ }
+ }
+
+ /**
* Dumps the local state of the display device.
* Does not need to dump the display device info because that is already dumped elsewhere.
*/