Native screen sent invalid orientation, it always returned 0.
So set orientation value once app informs to WebCotentsViewEfl.
Bug: http://web.sec.samsung.net/bugzilla/show_bug.cgi?id=13156
Reviewed by: Antonio Gomes, Hyunhak Kim, SeungSeop Park, arno renevier
Change-Id: Iee806175b3616d31188687f0dafd2dabc0fb1cb6
Signed-off-by: yh106.jung <yh106.jung@samsung.com>
#include "efl/window_factory.h"
#include "ui/events/event_switches.h"
#include "ui/gfx/image/image_skia.h"
+#include "ui/gfx/screen_efl.h"
#include "ui/gl/gl_shared_context_efl.h"
namespace content {
contents_impl.screen_orientation_dispatcher_host()->OnOrientationChange();
}
+ ui::SetScreenOrientation(orientation);
+
orientation_ = orientation;
}
#endif
#include "base/bind.h"
-#if defined(OS_TIZEN_MOBILE)
-#include "ui/gfx/display.h"
#include "ui/gfx/screen.h"
-#endif
#if defined(WEBRTC_DEBUG_DUMPFILE)
int fd_1 = -1;
DVLOG(3) << " width:" << frame->width
<< " height:" << frame->height;
-#if defined(OS_TIZEN_MOBILE)
- const gfx::Display display = gfx::Screen::GetNativeScreen()->GetPrimaryDisplay();
+ const gfx::Display display =
+ gfx::Screen::GetNativeScreen()->GetPrimaryDisplay();
int orientation = display.RotationAsDegree();
-#else
- int orientation = 0;
-#endif
gfx::Size target_resolution(frame->width, frame->height);
int target_rotation = (orientation +
GetCameraOrientation(self->device_name_.id().c_str())) % DEGREE_360;
#else
const float kDefaultDeviceScaleFactor = 1.0f;
#endif
+int g_screen_orientation = 0;
} // namespace
class ScreenEfl : public gfx::Screen {
gfx::Display display(0);
-# warning "Figure out proper way to get current screen orientation"
-#if 0
- // TODO(Youngsoo Choi): If there's a way to get orientation
- // from platform not using saved value, it would be better.
- display.SetRotationAsDegree(EWebView::GetOrientation());
-#endif
+ display.SetRotationAsDegree(g_screen_orientation);
int width, height;
#if defined(USE_WAYLAND)
gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, new ui::ScreenEfl());
}
}
+
+void SetScreenOrientation(int screen_orientation) {
+ g_screen_orientation = screen_orientation;
+}
} // namespace ui
namespace gfx {
void InstallScreenInstance();
+void SetScreenOrientation(int screen_orientation);
+
}
#endif