| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |