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

Side by Side Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

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, 1 month 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.h ('k') | third_party/WebKit/public/web/WebView.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 , m_chromeClientImpl(ChromeClientImpl::create(this)) 405 , m_chromeClientImpl(ChromeClientImpl::create(this))
406 , m_contextMenuClientImpl(this) 406 , m_contextMenuClientImpl(this)
407 , m_dragClientImpl(this) 407 , m_dragClientImpl(this)
408 , m_editorClientImpl(this) 408 , m_editorClientImpl(this)
409 , m_spellCheckerClientImpl(this) 409 , m_spellCheckerClientImpl(this)
410 , m_storageClientImpl(this) 410 , m_storageClientImpl(this)
411 , m_shouldAutoResize(false) 411 , m_shouldAutoResize(false)
412 , m_zoomLevel(0) 412 , m_zoomLevel(0)
413 , m_minimumZoomLevel(zoomFactorToZoomLevel(minTextSizeMultiplier)) 413 , m_minimumZoomLevel(zoomFactorToZoomLevel(minTextSizeMultiplier))
414 , m_maximumZoomLevel(zoomFactorToZoomLevel(maxTextSizeMultiplier)) 414 , m_maximumZoomLevel(zoomFactorToZoomLevel(maxTextSizeMultiplier))
415 , m_zoomFactorForDeviceScaleFactor(1.f)
415 , m_maximumLegibleScale(1) 416 , m_maximumLegibleScale(1)
416 , m_doubleTapZoomPageScaleFactor(0) 417 , m_doubleTapZoomPageScaleFactor(0)
417 , m_doubleTapZoomPending(false) 418 , m_doubleTapZoomPending(false)
418 , m_enableFakePageScaleAnimationForTesting(false) 419 , m_enableFakePageScaleAnimationForTesting(false)
419 , m_fakePageScaleAnimationPageScaleFactor(0) 420 , m_fakePageScaleAnimationPageScaleFactor(0)
420 , m_fakePageScaleAnimationUseAnchor(false) 421 , m_fakePageScaleAnimationUseAnchor(false)
421 , m_doingDragAndDrop(false) 422 , m_doingDragAndDrop(false)
422 , m_ignoreInputEvents(false) 423 , m_ignoreInputEvents(false)
423 , m_compositorDeviceScaleFactorOverride(0) 424 , m_compositorDeviceScaleFactorOverride(0)
424 , m_rootLayerScale(1) 425 , m_rootLayerScale(1)
(...skipping 2526 matching lines...) Expand 10 before | Expand all | Expand 10 after
2951 if (zoomLevel < m_minimumZoomLevel) 2952 if (zoomLevel < m_minimumZoomLevel)
2952 m_zoomLevel = m_minimumZoomLevel; 2953 m_zoomLevel = m_minimumZoomLevel;
2953 else if (zoomLevel > m_maximumZoomLevel) 2954 else if (zoomLevel > m_maximumZoomLevel)
2954 m_zoomLevel = m_maximumZoomLevel; 2955 m_zoomLevel = m_maximumZoomLevel;
2955 else 2956 else
2956 m_zoomLevel = zoomLevel; 2957 m_zoomLevel = zoomLevel;
2957 2958
2958 LocalFrame* frame = mainFrameImpl()->frame(); 2959 LocalFrame* frame = mainFrameImpl()->frame();
2959 if (!WebLocalFrameImpl::pluginContainerFromFrame(frame)) { 2960 if (!WebLocalFrameImpl::pluginContainerFromFrame(frame)) {
2960 float zoomFactor = m_zoomFactorOverride ? m_zoomFactorOverride : static_ cast<float>(zoomLevelToZoomFactor(m_zoomLevel)); 2961 float zoomFactor = m_zoomFactorOverride ? m_zoomFactorOverride : static_ cast<float>(zoomLevelToZoomFactor(m_zoomLevel));
2962 zoomFactor *= m_zoomFactorForDeviceScaleFactor;
2961 frame->setPageZoomFactor(zoomFactor); 2963 frame->setPageZoomFactor(zoomFactor);
2962 } 2964 }
2963 2965
2964 return m_zoomLevel; 2966 return m_zoomLevel;
2965 } 2967 }
2966 2968
2967 void WebViewImpl::zoomLimitsChanged(double minimumZoomLevel, 2969 void WebViewImpl::zoomLimitsChanged(double minimumZoomLevel,
2968 double maximumZoomLevel) 2970 double maximumZoomLevel)
2969 { 2971 {
2970 m_minimumZoomLevel = minimumZoomLevel; 2972 m_minimumZoomLevel = minimumZoomLevel;
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
3096 { 3098 {
3097 if (!page()) 3099 if (!page())
3098 return; 3100 return;
3099 3101
3100 page()->setDeviceScaleFactor(scaleFactor); 3102 page()->setDeviceScaleFactor(scaleFactor);
3101 3103
3102 if (m_layerTreeView) 3104 if (m_layerTreeView)
3103 updateLayerTreeDeviceScaleFactor(); 3105 updateLayerTreeDeviceScaleFactor();
3104 } 3106 }
3105 3107
3108 void WebViewImpl::setZoomFactorForDeviceScaleFactor(float zoomFactorForDeviceSca leFactor)
3109 {
3110 m_zoomFactorForDeviceScaleFactor = zoomFactorForDeviceScaleFactor;
3111 if (!m_layerTreeView)
3112 return;
3113 setZoomLevel(m_zoomLevel);
3114 }
3115
3106 void WebViewImpl::setDeviceColorProfile(const WebVector<char>& colorProfile) 3116 void WebViewImpl::setDeviceColorProfile(const WebVector<char>& colorProfile)
3107 { 3117 {
3108 if (!page()) 3118 if (!page())
3109 return; 3119 return;
3110 3120
3111 Vector<char> deviceProfile; 3121 Vector<char> deviceProfile;
3112 deviceProfile.append(colorProfile.data(), colorProfile.size()); 3122 deviceProfile.append(colorProfile.data(), colorProfile.size());
3113 3123
3114 page()->setDeviceColorProfile(deviceProfile); 3124 page()->setDeviceColorProfile(deviceProfile);
3115 } 3125 }
(...skipping 1318 matching lines...) Expand 10 before | Expand all | Expand 10 after
4434 if (m_pageColorOverlay) 4444 if (m_pageColorOverlay)
4435 m_pageColorOverlay->update(); 4445 m_pageColorOverlay->update();
4436 if (InspectorOverlay* overlay = inspectorOverlay()) { 4446 if (InspectorOverlay* overlay = inspectorOverlay()) {
4437 PageOverlay* inspectorPageOverlay = overlay->pageOverlay(); 4447 PageOverlay* inspectorPageOverlay = overlay->pageOverlay();
4438 if (inspectorPageOverlay) 4448 if (inspectorPageOverlay)
4439 inspectorPageOverlay->update(); 4449 inspectorPageOverlay->update();
4440 } 4450 }
4441 } 4451 }
4442 4452
4443 } // namespace blink 4453 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.h ('k') | third_party/WebKit/public/web/WebView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698