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

Unified Diff: content/browser/renderer_host/render_widget_host_view_base.cc

Issue 12328080: Plumb physical backing size from RWHV to renderer CC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adjust for call renamed to GetViewportSizePix() Created 7 years, 10 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 | « content/browser/renderer_host/render_widget_host_view_base.h ('k') | content/common/view_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_base.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_base.cc b/content/browser/renderer_host/render_widget_host_view_base.cc
index a2cb5a43a93fdd7d5d0695e2b93ca37fde06f552..f56413e6140e1a673edd60ac3938d6cbd1b5e734 100644
--- a/content/browser/renderer_host/render_widget_host_view_base.cc
+++ b/content/browser/renderer_host/render_widget_host_view_base.cc
@@ -12,6 +12,8 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h"
#include "ui/gfx/display.h"
#include "ui/gfx/screen.h"
+#include "ui/gfx/size_conversions.h"
+#include "ui/gfx/size_f.h"
#if defined(OS_WIN)
#include "base/command_line.h"
@@ -365,6 +367,14 @@ const SkBitmap& RenderWidgetHostViewBase::GetBackground() {
return background_;
}
+gfx::Size RenderWidgetHostViewBase::GetPhysicalBackingSize() const {
+ gfx::Display display =
+ gfx::Screen::GetNativeScreen()->GetDisplayNearestPoint(
+ GetViewBounds().origin());
+ return gfx::ToCeiledSize(gfx::ScaleSize(GetViewBounds().size(),
+ display.device_scale_factor()));
+}
+
void RenderWidgetHostViewBase::SelectionChanged(const string16& text,
size_t offset,
const ui::Range& range) {
@@ -432,11 +442,17 @@ void RenderWidgetHostViewBase::UpdateScreenInfo(gfx::NativeView view) {
if (current_display_area_ == display.work_area() &&
current_device_scale_factor_ == display.device_scale_factor())
return;
+
+ bool device_scale_factor_changed =
+ current_device_scale_factor_ != display.device_scale_factor();
current_display_area_ = display.work_area();
current_device_scale_factor_ = display.device_scale_factor();
- if (impl)
+ if (impl) {
+ if (device_scale_factor_changed)
+ impl->WasResized();
impl->NotifyScreenInfoChanged();
}
+}
SmoothScrollGesture* RenderWidgetHostViewBase::CreateSmoothScrollGesture(
bool scroll_down, int pixels_to_scroll, int mouse_event_x,
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_base.h ('k') | content/common/view_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698