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

Unified Diff: sky/viewer/document_view.cc

Issue 868263002: Sky shouldn't crash on device rotate (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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 | « sky/compositor/texture_cache.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/viewer/document_view.cc
diff --git a/sky/viewer/document_view.cc b/sky/viewer/document_view.cc
index cf48567326bc26586232d47481fbbeba49e07d77..ab1516d0d5345835eae0d6bb1e2da12646fe0510 100644
--- a/sky/viewer/document_view.cc
+++ b/sky/viewer/document_view.cc
@@ -270,8 +270,9 @@ void DocumentView::OnViewBoundsChanged(mojo::View* view,
const mojo::Rect& old_bounds,
const mojo::Rect& new_bounds) {
DCHECK_EQ(view, root_);
- gfx::Size size = new_bounds.To<gfx::Rect>().size();
- web_view_->resize(size);
+ float device_pixel_ratio = GetDevicePixelRatio();
+ web_view_->resize(blink::WebSize(new_bounds.width / device_pixel_ratio,
+ new_bounds.height / device_pixel_ratio));
}
void DocumentView::OnViewFocusChanged(mojo::View* gained_focus,
« no previous file with comments | « sky/compositor/texture_cache.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698