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

Unified Diff: content/renderer/render_view_impl.cc

Issue 1412663005: Introduce painted-device-scale-factor and use it when --enable-use-zoom-for-dsf is specified. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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/renderer/render_view_impl.h ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 584854c2f1c4724dff935a339d77194352d91e79..dadfdbb01e7af1096b7033b329c3f4a4e530c848 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -38,6 +38,7 @@
#include "content/child/v8_value_converter_impl.h"
#include "content/child/webmessageportchannel_impl.h"
#include "content/common/content_constants_internal.h"
+#include "content/common/content_switches_internal.h"
#include "content/common/database_messages.h"
#include "content/common/dom_storage/dom_storage_types.h"
#include "content/common/drag_messages.h"
@@ -745,8 +746,7 @@ void RenderViewImpl::Initialize(const ViewMsg_New_Params& params,
// completing initialization. Otherwise, we can finish it now.
if (opener_id_ == MSG_ROUTING_NONE)
did_show_ = true;
-
- webview()->setDeviceScaleFactor(device_scale_factor_);
+ UpdateDeviceScaleFactor();
webview()->setDisplayMode(display_mode_);
webview()->settings()->setPreferCompositingToLCDTextEnabled(
PreferCompositingToLCDText(compositor_deps_, device_scale_factor_));
@@ -3195,7 +3195,7 @@ void RenderViewImpl::OnImeConfirmComposition(
void RenderViewImpl::SetDeviceScaleFactor(float device_scale_factor) {
RenderWidget::SetDeviceScaleFactor(device_scale_factor);
if (webview()) {
- webview()->setDeviceScaleFactor(device_scale_factor);
+ UpdateDeviceScaleFactor();
webview()->settings()->setPreferCompositingToLCDTextEnabled(
PreferCompositingToLCDText(compositor_deps_, device_scale_factor_));
}
@@ -3703,4 +3703,14 @@ void RenderViewImpl::DidStopLoadingIcons() {
SendUpdateFaviconURL(urls);
}
+void RenderViewImpl::UpdateDeviceScaleFactor() {
+ if (IsUseZoomForDSFEnabled()) {
+ compositor_->SetPaintedDeviceScaleFactor(device_scale_factor_);
+ webview()->setZoomFactorForDeviceScaleFactor(
+ device_scale_factor_);
+ } else {
+ webview()->setDeviceScaleFactor(device_scale_factor_);
+ }
+}
+
} // namespace content
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698