OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "blimp/client/compositor/blimp_compositor_android.h" | 5 #include "blimp/client/compositor/blimp_compositor_android.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "ui/gfx/geometry/size.h" | 9 #include "ui/gfx/geometry/size.h" |
10 | 10 |
11 namespace { | 11 namespace { |
12 // The minimum valid content width in a tile. This is used to make sure the | 12 // The minimum valid content width in a tile. This is used to make sure the |
13 // width of the content on the rightmost tile isn't a tiny sliver. | 13 // width of the content on the rightmost tile isn't a tiny sliver. |
14 const int kMinimumTileContentWidthPixels = 64; | 14 const int kMinimumTileContentWidthPixels = 64; |
15 } | 15 } |
16 | 16 |
17 namespace blimp { | 17 namespace blimp { |
| 18 namespace client { |
18 | 19 |
19 // static | 20 // static |
20 scoped_ptr<BlimpCompositorAndroid> BlimpCompositorAndroid::Create( | 21 scoped_ptr<BlimpCompositorAndroid> BlimpCompositorAndroid::Create( |
21 const gfx::Size& real_size, | 22 const gfx::Size& real_size, |
22 const gfx::Size& size, | 23 const gfx::Size& size, |
23 float dp_to_px, | 24 float dp_to_px, |
24 RenderWidgetFeature* render_widget_feature) { | 25 RenderWidgetFeature* render_widget_feature) { |
25 gfx::Size device_size(real_size); | 26 gfx::Size device_size(real_size); |
26 bool real_size_supported = true; | 27 bool real_size_supported = true; |
27 if (device_size.IsEmpty()) { | 28 if (device_size.IsEmpty()) { |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // just estimates the values above using tile counts. | 84 // just estimates the values above using tile counts. |
84 int numTiles = (portrait_width_ * landscape_width_) / (256 * 256); | 85 int numTiles = (portrait_width_ * landscape_width_) / (256 * 256); |
85 if (numTiles > 16) | 86 if (numTiles > 16) |
86 default_tile_size = 384; | 87 default_tile_size = 384; |
87 if (numTiles >= 40) | 88 if (numTiles >= 40) |
88 default_tile_size = 512; | 89 default_tile_size = 512; |
89 } | 90 } |
90 settings->default_tile_size.SetSize(default_tile_size, default_tile_size); | 91 settings->default_tile_size.SetSize(default_tile_size, default_tile_size); |
91 } | 92 } |
92 | 93 |
| 94 } // namespace client |
93 } // namespace blimp | 95 } // namespace blimp |
OLD | NEW |