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

Unified Diff: ui/android/java/src/org/chromium/ui/display/VirtualDisplayAndroid.java

Issue 2523273002: Implement Virtual Display class for Android. (Closed)
Patch Set: getObservers() to private Created 4 years, 1 month 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
« no previous file with comments | « ui/android/java/src/org/chromium/ui/display/PhysicalDisplayAndroid.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/android/java/src/org/chromium/ui/display/VirtualDisplayAndroid.java
diff --git a/ui/android/java/src/org/chromium/ui/display/VirtualDisplayAndroid.java b/ui/android/java/src/org/chromium/ui/display/VirtualDisplayAndroid.java
new file mode 100644
index 0000000000000000000000000000000000000000..476e93439ed6cd7749f6dc82f8397a74d1badf38
--- /dev/null
+++ b/ui/android/java/src/org/chromium/ui/display/VirtualDisplayAndroid.java
@@ -0,0 +1,43 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.ui.display;
+
+import android.graphics.Point;
+
+/**
+ * An instance of DisplayAndroid not associated with any physical display.
+ */
+public class VirtualDisplayAndroid extends DisplayAndroid {
+ public static VirtualDisplayAndroid createVirtualDisplay() {
+ return getManager().addVirtualDisplay();
+ }
+
+ /* package */ VirtualDisplayAndroid(int displayId) {
+ super(displayId);
+ }
+
+ /**
+ * @param other Sets the properties of this display to those of the other display.
+ */
+ public void setTo(DisplayAndroid other) {
+ update(new Point(other.getDisplayWidth(), other.getDisplayHeight()),
+ new Point(other.getPhysicalDisplayWidth(), other.getPhysicalDisplayHeight()),
+ other.getDipScale(), other.getBitsPerPixel(),
+ other.getBitsPerComponent(), other.getRotation());
+ }
+
+ @Override
+ public void update(Point size, Point physicalSize, Float dipScale, Integer bitsPerPixel,
+ Integer bitsPerComponent, Integer rotation) {
+ super.update(size, physicalSize, dipScale, bitsPerPixel, bitsPerComponent, rotation);
+ }
+
+ /**
+ * Removes this Virtual Display from the DisplayManger.
+ */
+ public void destroy() {
+ getManager().removeVirtualDisplay(this);
+ }
+}
« no previous file with comments | « ui/android/java/src/org/chromium/ui/display/PhysicalDisplayAndroid.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698