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 <limits> | 7 #include <limits> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 render_thread->is_gpu_rasterization_enabled(); | 233 render_thread->is_gpu_rasterization_enabled(); |
234 settings.can_use_lcd_text = render_thread->is_lcd_text_enabled(); | 234 settings.can_use_lcd_text = render_thread->is_lcd_text_enabled(); |
235 settings.use_distance_field_text = | 235 settings.use_distance_field_text = |
236 render_thread->is_distance_field_text_enabled(); | 236 render_thread->is_distance_field_text_enabled(); |
237 settings.use_zero_copy = render_thread->is_zero_copy_enabled(); | 237 settings.use_zero_copy = render_thread->is_zero_copy_enabled(); |
238 settings.use_one_copy = render_thread->is_one_copy_enabled(); | 238 settings.use_one_copy = render_thread->is_one_copy_enabled(); |
239 settings.use_image_texture_target = | 239 settings.use_image_texture_target = |
240 render_thread->use_image_texture_target(); | 240 render_thread->use_image_texture_target(); |
241 } | 241 } |
242 | 242 |
| 243 settings.renderer_settings.enable_tile_compression = |
| 244 cc::switches::IsTileCompressionEnabled(); |
| 245 if (cmd->HasSwitch(cc::switches::kTileCompressionThreshold)) { |
| 246 int threshold; |
| 247 if (GetSwitchValueAsInt(*cmd, cc::switches::kTileCompressionThreshold, -1, |
| 248 2, &threshold)) { |
| 249 settings.renderer_settings.tile_compression_threshold = threshold; |
| 250 } |
| 251 } |
| 252 if (cmd->HasSwitch(cc::switches::kTileCompressionMethod)) { |
| 253 int method; |
| 254 if (GetSwitchValueAsInt(*cmd, cc::switches::kTileCompressionMethod, 0, |
| 255 cc::TILE_COMPRESSION_METHOD_COUNT - 1, &method)) { |
| 256 settings.renderer_settings.tile_compression_method = |
| 257 static_cast<cc::TileCompressionMethod>(method); |
| 258 } |
| 259 } |
| 260 |
243 settings.calculate_top_controls_position = | 261 settings.calculate_top_controls_position = |
244 cmd->HasSwitch(cc::switches::kEnableTopControlsPositionCalculation); | 262 cmd->HasSwitch(cc::switches::kEnableTopControlsPositionCalculation); |
245 if (cmd->HasSwitch(cc::switches::kTopControlsShowThreshold)) { | 263 if (cmd->HasSwitch(cc::switches::kTopControlsShowThreshold)) { |
246 std::string top_threshold_str = | 264 std::string top_threshold_str = |
247 cmd->GetSwitchValueASCII(cc::switches::kTopControlsShowThreshold); | 265 cmd->GetSwitchValueASCII(cc::switches::kTopControlsShowThreshold); |
248 double show_threshold; | 266 double show_threshold; |
249 if (base::StringToDouble(top_threshold_str, &show_threshold) && | 267 if (base::StringToDouble(top_threshold_str, &show_threshold) && |
250 show_threshold >= 0.f && show_threshold <= 1.f) | 268 show_threshold >= 0.f && show_threshold <= 1.f) |
251 settings.top_controls_show_threshold = show_threshold; | 269 settings.top_controls_show_threshold = show_threshold; |
252 } | 270 } |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
903 widget_->OnSwapBuffersAborted(); | 921 widget_->OnSwapBuffersAborted(); |
904 } | 922 } |
905 | 923 |
906 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { | 924 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { |
907 cc::ContextProvider* provider = | 925 cc::ContextProvider* provider = |
908 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); | 926 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); |
909 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 927 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
910 } | 928 } |
911 | 929 |
912 } // namespace content | 930 } // namespace content |
OLD | NEW |