@@ -63,8 +63,11 @@ double ComputePixelRatio(flutter::TizenViewBase* view) {
6363namespace flutter {
6464
6565FlutterTizenView::FlutterTizenView (FlutterViewId view_id,
66- std::unique_ptr<TizenViewBase> tizen_view)
67- : view_id_(view_id), tizen_view_(std::move(tizen_view)) {
66+ std::unique_ptr<TizenViewBase> tizen_view,
67+ double user_pixel_ratio)
68+ : view_id_(view_id),
69+ tizen_view_ (std::move(tizen_view)),
70+ user_pixel_ratio_(user_pixel_ratio) {
6871 tizen_view_->SetView (this );
6972
7073 if (auto * window = dynamic_cast <TizenWindow*>(tizen_view_.get ())) {
@@ -98,7 +101,12 @@ void FlutterTizenView::SetEngine(std::unique_ptr<FlutterTizenEngine> engine) {
98101 platform_channel_ =
99102 std::make_unique<PlatformChannel>(messenger, tizen_view_.get ());
100103
101- double pixel_ratio = ComputePixelRatio (tizen_view_.get ());
104+ double pixel_ratio;
105+ if (user_pixel_ratio_ == 0.0 ) {
106+ pixel_ratio = ComputePixelRatio (tizen_view_.get ());
107+ } else {
108+ pixel_ratio = user_pixel_ratio_;
109+ }
102110 platform_view_channel_ =
103111 std::make_unique<PlatformViewChannel>(messenger, pixel_ratio);
104112 mouse_cursor_channel_ =
@@ -219,7 +227,8 @@ void FlutterTizenView::OnRotate(int32_t degree) {
219227
220228 engine_->renderer ()->ResizeSurface (width, height);
221229
222- // Window position does not change on rotation regardless of its orientation.
230+ // Window position does not change on rotation regardless of its
231+ // orientation.
223232 SendWindowMetrics (geometry.left , geometry.top , width, height, 0.0 );
224233}
225234
@@ -397,7 +406,11 @@ void FlutterTizenView::SendWindowMetrics(int32_t left,
397406 int32_t height,
398407 double pixel_ratio) {
399408 if (pixel_ratio == 0.0 ) {
400- pixel_ratio = ComputePixelRatio (tizen_view_.get ());
409+ if (user_pixel_ratio_ == 0.0 ) {
410+ pixel_ratio = ComputePixelRatio (tizen_view_.get ());
411+ } else {
412+ pixel_ratio = user_pixel_ratio_;
413+ }
401414 }
402415
403416 engine_->SendWindowMetrics (left, top, width, height, pixel_ratio);
@@ -424,8 +437,8 @@ void FlutterTizenView::SendFlutterPointerEvent(FlutterPointerPhase phase,
424437 new_y = geometry.width - x;
425438 }
426439
427- // If the pointer isn't already added, synthesize an add to satisfy Flutter's
428- // expectations about events.
440+ // If the pointer isn't already added, synthesize an add to satisfy
441+ // Flutter's expectations about events.
429442 if (!state->flutter_state_is_added ) {
430443 FlutterPointerEvent event = {};
431444 event.struct_size = sizeof (event);
0 commit comments