Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / ui / gfx / android / shared_device_display_info.cc
index ae02ef5..c58813d 100644 (file)
@@ -21,12 +21,13 @@ static void UpdateSharedDeviceDisplayInfo(JNIEnv* env,
                                           jint bits_per_pixel,
                                           jint bits_per_component,
                                           jdouble dip_scale,
-                                          jint smallest_dip_width) {
+                                          jint smallest_dip_width,
+                                          jint rotation_degrees) {
   SharedDeviceDisplayInfo::GetInstance()->InvokeUpdate(env, obj,
       display_height, display_width,
       physical_display_height, physical_display_width,
       bits_per_pixel, bits_per_component,
-      dip_scale, smallest_dip_width);
+      dip_scale, smallest_dip_width, rotation_degrees);
 }
 
 // static
@@ -80,6 +81,11 @@ int SharedDeviceDisplayInfo::GetSmallestDIPWidth() {
   return smallest_dip_width_;
 }
 
+int SharedDeviceDisplayInfo::GetRotationDegrees() {
+  base::AutoLock autolock(lock_);
+  return rotation_degrees_;
+}
+
 // static
 bool SharedDeviceDisplayInfo::RegisterSharedDeviceDisplayInfo(JNIEnv* env) {
   return RegisterNativesImpl(env);
@@ -94,14 +100,15 @@ void SharedDeviceDisplayInfo::InvokeUpdate(JNIEnv* env,
                                            jint bits_per_pixel,
                                            jint bits_per_component,
                                            jdouble dip_scale,
-                                           jint smallest_dip_width) {
+                                           jint smallest_dip_width,
+                                           jint rotation_degrees) {
   base::AutoLock autolock(lock_);
 
   UpdateDisplayInfo(env, obj,
       display_height, display_width,
       physical_display_height, physical_display_width,
       bits_per_pixel, bits_per_component, dip_scale,
-      smallest_dip_width);
+      smallest_dip_width, rotation_degrees);
 }
 
 SharedDeviceDisplayInfo::SharedDeviceDisplayInfo()
@@ -124,7 +131,8 @@ SharedDeviceDisplayInfo::SharedDeviceDisplayInfo()
       Java_DeviceDisplayInfo_getBitsPerPixel(env, j_device_info_.obj()),
       Java_DeviceDisplayInfo_getBitsPerComponent(env, j_device_info_.obj()),
       Java_DeviceDisplayInfo_getDIPScale(env, j_device_info_.obj()),
-      Java_DeviceDisplayInfo_getSmallestDIPWidth(env, j_device_info_.obj()));
+      Java_DeviceDisplayInfo_getSmallestDIPWidth(env, j_device_info_.obj()),
+      Java_DeviceDisplayInfo_getRotationDegrees(env, j_device_info_.obj()));
 }
 
 SharedDeviceDisplayInfo::~SharedDeviceDisplayInfo() {
@@ -139,7 +147,8 @@ void SharedDeviceDisplayInfo::UpdateDisplayInfo(JNIEnv* env,
                                                 jint bits_per_pixel,
                                                 jint bits_per_component,
                                                 jdouble dip_scale,
-                                                jint smallest_dip_width) {
+                                                jint smallest_dip_width,
+                                                jint rotation_degrees) {
   display_height_ = static_cast<int>(display_height);
   display_width_ = static_cast<int>(display_width);
   physical_display_height_ = static_cast<int>(physical_display_height);
@@ -148,6 +157,7 @@ void SharedDeviceDisplayInfo::UpdateDisplayInfo(JNIEnv* env,
   bits_per_component_ = static_cast<int>(bits_per_component);
   dip_scale_ = static_cast<double>(dip_scale);
   smallest_dip_width_ = static_cast<int>(smallest_dip_width);
+  rotation_degrees_ = static_cast<int>(rotation_degrees);
 }
 
 }  // namespace gfx