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

Side by Side Diff: content/renderer/gpu/render_widget_compositor.cc

Issue 1838823002: Mac: Use 512x512 tiles by default when on high DPI devices (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/gpu/render_widget_compositor.h" 5 #include "content/renderer/gpu/render_widget_compositor.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <limits> 8 #include <limits>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 default_tile_size += 32; 171 default_tile_size += 32;
172 } else { 172 } else {
173 // We don't know the exact resolution due to screen controls etc. 173 // We don't know the exact resolution due to screen controls etc.
174 // So this just estimates the values above using tile counts. 174 // So this just estimates the values above using tile counts.
175 int numTiles = (display_width * display_height) / (256 * 256); 175 int numTiles = (display_width * display_height) / (256 * 256);
176 if (numTiles > 16) 176 if (numTiles > 16)
177 default_tile_size = 384; 177 default_tile_size = 384;
178 if (numTiles >= 40) 178 if (numTiles >= 40)
179 default_tile_size = 512; 179 default_tile_size = 512;
180 } 180 }
181 #elif defined(OS_CHROMEOS) 181 #elif defined(OS_CHROMEOS) || defined(OS_MACOSX)
182 // Use 512 for high DPI (dsf=2.0f) devices. 182 // Use 512 for high DPI (dsf=2.0f) devices.
183 if (initial_device_scale_factor >= 2.0f) 183 if (initial_device_scale_factor >= 2.0f)
184 default_tile_size = 512; 184 default_tile_size = 512;
185 #endif 185 #endif
186 186
187 return gfx::Size(default_tile_size, default_tile_size); 187 return gfx::Size(default_tile_size, default_tile_size);
188 } 188 }
189 189
190 // Check cc::TopControlsState, and blink::WebTopControlsState 190 // Check cc::TopControlsState, and blink::WebTopControlsState
191 // are kept in sync. 191 // are kept in sync.
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after
1135 #endif 1135 #endif
1136 return actual; 1136 return actual;
1137 } 1137 }
1138 1138
1139 void RenderWidgetCompositor::SetPaintedDeviceScaleFactor( 1139 void RenderWidgetCompositor::SetPaintedDeviceScaleFactor(
1140 float device_scale) { 1140 float device_scale) {
1141 layer_tree_host_->SetPaintedDeviceScaleFactor(device_scale); 1141 layer_tree_host_->SetPaintedDeviceScaleFactor(device_scale);
1142 } 1142 }
1143 1143
1144 } // namespace content 1144 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698