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

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

Issue 309593007: Expand GPU rasterization trigger for Finch experiment (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use a WebSetting Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/web/WebSettingsImpl.cpp ('k') | Source/web/tests/ViewportTest.cpp » ('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 2865 matching lines...) Expand 10 before | Expand all | Expand 10 after
2876 view->layout(); 2876 view->layout();
2877 } 2877 }
2878 2878
2879 void WebViewImpl::updatePageDefinedViewportConstraints(const ViewportDescription & description) 2879 void WebViewImpl::updatePageDefinedViewportConstraints(const ViewportDescription & description)
2880 { 2880 {
2881 if (!settings()->viewportEnabled() || !page() || (!m_size.width && !m_size.h eight)) 2881 if (!settings()->viewportEnabled() || !page() || (!m_size.width && !m_size.h eight))
2882 return; 2882 return;
2883 2883
2884 Document* document = page()->mainFrame()->document(); 2884 Document* document = page()->mainFrame()->document();
2885 2885
2886 m_matchesHeuristicsForGpuRasterization = description.maxWidth == Length(Devi ceWidth) 2886 if (settingsImpl()->useExpandedHeuristicsForGpuRasterization()) {
2887 && description.minZoom == 1.0 2887 m_matchesHeuristicsForGpuRasterization = description.maxWidth == Length( DeviceWidth)
2888 && description.minZoomIsExplicit 2888 && description.minZoom == 1.0
2889 && description.zoom == 1.0 2889 && description.minZoomIsExplicit;
2890 && description.zoomIsExplicit 2890 } else {
2891 && description.userZoom 2891 m_matchesHeuristicsForGpuRasterization = description.maxWidth == Length( DeviceWidth)
2892 && description.userZoomIsExplicit; 2892 && description.minZoom == 1.0
2893 && description.minZoomIsExplicit
2894 && description.zoom == 1.0
2895 && description.zoomIsExplicit
2896 && description.userZoom
2897 && description.userZoomIsExplicit;
2898 }
2893 if (m_layerTreeView) 2899 if (m_layerTreeView)
2894 m_layerTreeView->heuristicsForGpuRasterizationUpdated(m_matchesHeuristic sForGpuRasterization); 2900 m_layerTreeView->heuristicsForGpuRasterizationUpdated(m_matchesHeuristic sForGpuRasterization);
2895 2901
2896 Length defaultMinWidth = document->viewportDefaultMinWidth(); 2902 Length defaultMinWidth = document->viewportDefaultMinWidth();
2897 if (defaultMinWidth.isAuto()) 2903 if (defaultMinWidth.isAuto())
2898 defaultMinWidth = Length(ExtendToZoom); 2904 defaultMinWidth = Length(ExtendToZoom);
2899 2905
2900 ViewportDescription adjustedDescription = description; 2906 ViewportDescription adjustedDescription = description;
2901 if (settingsImpl()->viewportMetaLayoutSizeQuirk() && adjustedDescription.typ e == ViewportDescription::ViewportMeta) { 2907 if (settingsImpl()->viewportMetaLayoutSizeQuirk() && adjustedDescription.typ e == ViewportDescription::ViewportMeta) {
2902 const int legacyWidthSnappingMagicNumber = 320; 2908 const int legacyWidthSnappingMagicNumber = 320;
(...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after
4051 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 4057 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
4052 4058
4053 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 4059 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
4054 return false; 4060 return false;
4055 4061
4056 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4062 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4057 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4063 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4058 } 4064 }
4059 4065
4060 } // namespace blink 4066 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebSettingsImpl.cpp ('k') | Source/web/tests/ViewportTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698