diff options
| author | Jeff Brown <jeffbrown@google.com> | 2012-08-31 15:49:11 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-08-31 15:49:17 -0700 |
| commit | f83ec838915c13158ddfda0cf4da5865b260b9c6 (patch) | |
| tree | 81d0e7f24330cd5a28d5bfd6e899acee6388b562 /core/java/android/view/Surface.java | |
| parent | 3b9a4160c99b2375b4874ccabf92eac68be06af6 (diff) | |
| parent | 4ed8fe75e1dde1a2b9576f3862aecc5a572c56b5 (diff) | |
| download | frameworks_base-f83ec838915c13158ddfda0cf4da5865b260b9c6.zip frameworks_base-f83ec838915c13158ddfda0cf4da5865b260b9c6.tar.gz frameworks_base-f83ec838915c13158ddfda0cf4da5865b260b9c6.tar.bz2 | |
Merge "More improvements to the display manager." into jb-mr1-dev
Diffstat (limited to 'core/java/android/view/Surface.java')
| -rw-r--r-- | core/java/android/view/Surface.java | 46 |
1 files changed, 44 insertions, 2 deletions
diff --git a/core/java/android/view/Surface.java b/core/java/android/view/Surface.java index cf1767d..6616894 100644 --- a/core/java/android/view/Surface.java +++ b/core/java/android/view/Surface.java @@ -743,17 +743,59 @@ public class Surface implements Parcelable { } /** - * Describes the properties of a physical display. + * Describes the properties of a physical display known to surface flinger. * @hide */ public static final class PhysicalDisplayInfo { - // TODO: redesign this public int width; public int height; public float refreshRate; public float density; public float xDpi; public float yDpi; + + public PhysicalDisplayInfo() { + } + + public PhysicalDisplayInfo(PhysicalDisplayInfo other) { + copyFrom(other); + } + + @Override + public boolean equals(Object o) { + return o instanceof PhysicalDisplayInfo && equals((PhysicalDisplayInfo)o); + } + + public boolean equals(PhysicalDisplayInfo other) { + return other != null + && width == other.width + && height == other.height + && refreshRate == other.refreshRate + && density == other.density + && xDpi == other.xDpi + && yDpi == other.yDpi; + } + + @Override + public int hashCode() { + return 0; // don't care + } + + public void copyFrom(PhysicalDisplayInfo other) { + width = other.width; + height = other.height; + refreshRate = other.refreshRate; + density = other.density; + xDpi = other.xDpi; + yDpi = other.yDpi; + } + + // For debugging purposes + @Override + public String toString() { + return "PhysicalDisplayInfo{" + width + " x " + height + ", " + refreshRate + " fps, " + + "density " + density + ", " + xDpi + " x " + yDpi + " dpi}"; + } } /** |
