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

Unified Diff: ui/gfx/android/shared_device_display_info.cc

Issue 93933016: Android: Add support for returning real screen resolution. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add temp point and fix braces. Created 6 years, 11 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
« no previous file with comments | « ui/gfx/android/shared_device_display_info.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/android/shared_device_display_info.cc
diff --git a/ui/gfx/android/shared_device_display_info.cc b/ui/gfx/android/shared_device_display_info.cc
index 9ac18d0218da6a024ed42031112a64a1e38b0d89..32dc73e54e10527852408d4cfcca57dcaff6484d 100644
--- a/ui/gfx/android/shared_device_display_info.cc
+++ b/ui/gfx/android/shared_device_display_info.cc
@@ -16,12 +16,16 @@ static void UpdateSharedDeviceDisplayInfo(JNIEnv* env,
jobject obj,
jint display_height,
jint display_width,
+ jint physical_display_height,
+ jint physical_display_width,
jint bits_per_pixel,
jint bits_per_component,
jdouble dip_scale,
jint smallest_dip_width) {
SharedDeviceDisplayInfo::GetInstance()->InvokeUpdate(env, obj,
- display_height, display_width, bits_per_pixel, bits_per_component,
+ display_height, display_width,
+ physical_display_height, physical_display_width,
+ bits_per_pixel, bits_per_component,
dip_scale, smallest_dip_width);
}
@@ -42,6 +46,16 @@ int SharedDeviceDisplayInfo::GetDisplayWidth() {
return display_width_;
}
+int SharedDeviceDisplayInfo::GetPhysicalDisplayHeight() {
+ base::AutoLock autolock(lock_);
+ return physical_display_height_;
+}
+
+int SharedDeviceDisplayInfo::GetPhysicalDisplayWidth() {
+ base::AutoLock autolock(lock_);
+ return physical_display_width_;
+}
+
int SharedDeviceDisplayInfo::GetBitsPerPixel() {
base::AutoLock autolock(lock_);
DCHECK_NE(0, bits_per_pixel_);
@@ -75,14 +89,18 @@ void SharedDeviceDisplayInfo::InvokeUpdate(JNIEnv* env,
jobject obj,
jint display_height,
jint display_width,
+ jint physical_display_height,
+ jint physical_display_width,
jint bits_per_pixel,
jint bits_per_component,
jdouble dip_scale,
jint smallest_dip_width) {
base::AutoLock autolock(lock_);
- UpdateDisplayInfo(env, obj, display_height,
- display_width, bits_per_pixel, bits_per_component, dip_scale,
+ UpdateDisplayInfo(env, obj,
+ display_height, display_width,
+ physical_display_height, physical_display_width,
+ bits_per_pixel, bits_per_component, dip_scale,
smallest_dip_width);
}
@@ -100,6 +118,9 @@ SharedDeviceDisplayInfo::SharedDeviceDisplayInfo()
UpdateDisplayInfo(env, j_device_info_.obj(),
Java_DeviceDisplayInfo_getDisplayHeight(env, j_device_info_.obj()),
Java_DeviceDisplayInfo_getDisplayWidth(env, j_device_info_.obj()),
+ Java_DeviceDisplayInfo_getPhysicalDisplayHeight(env,
+ j_device_info_.obj()),
+ Java_DeviceDisplayInfo_getPhysicalDisplayWidth(env, j_device_info_.obj()),
Java_DeviceDisplayInfo_getBitsPerPixel(env, j_device_info_.obj()),
Java_DeviceDisplayInfo_getBitsPerComponent(env, j_device_info_.obj()),
Java_DeviceDisplayInfo_getDIPScale(env, j_device_info_.obj()),
@@ -113,12 +134,16 @@ void SharedDeviceDisplayInfo::UpdateDisplayInfo(JNIEnv* env,
jobject jobj,
jint display_height,
jint display_width,
+ jint physical_display_height,
+ jint physical_display_width,
jint bits_per_pixel,
jint bits_per_component,
jdouble dip_scale,
jint smallest_dip_width) {
display_height_ = static_cast<int>(display_height);
display_width_ = static_cast<int>(display_width);
+ physical_display_height_ = static_cast<int>(physical_display_height);
+ physical_display_width_ = static_cast<int>(physical_display_width);
bits_per_pixel_ = static_cast<int>(bits_per_pixel);
bits_per_component_ = static_cast<int>(bits_per_component);
dip_scale_ = static_cast<double>(dip_scale);
« no previous file with comments | « ui/gfx/android/shared_device_display_info.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698