Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/render_thread_impl.h" | 5 #include "content/renderer/render_thread_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 579 #else | 579 #else |
| 580 is_lcd_text_enabled_ = true; | 580 is_lcd_text_enabled_ = true; |
| 581 #endif | 581 #endif |
| 582 } | 582 } |
| 583 | 583 |
| 584 is_gpu_rasterization_enabled_ = | 584 is_gpu_rasterization_enabled_ = |
| 585 command_line.HasSwitch(switches::kEnableGpuRasterization); | 585 command_line.HasSwitch(switches::kEnableGpuRasterization); |
| 586 is_gpu_rasterization_forced_ = | 586 is_gpu_rasterization_forced_ = |
| 587 command_line.HasSwitch(switches::kForceGpuRasterization); | 587 command_line.HasSwitch(switches::kForceGpuRasterization); |
| 588 | 588 |
| 589 if (command_line.HasSwitch(switches::kGpuRasterizationMSAASampleCount)) { | |
| 590 std::string string_value = command_line.GetSwitchValueASCII( | |
| 591 switches::kGpuRasterizationMSAASampleCount); | |
| 592 bool parsed_msaa_sample_count = | |
| 593 base::StringToInt(string_value, &gpu_rasterization_msaa_sample_count_) ; | |
|
danakj
2015/01/26 21:04:32
git cl format
Stephen White
2015/01/26 22:39:51
Done.
| |
| 594 DCHECK(parsed_msaa_sample_count) << string_value; | |
| 595 DCHECK_GT(gpu_rasterization_msaa_sample_count_, 0); | |
| 596 DCHECK_LE(gpu_rasterization_msaa_sample_count_, 16); | |
|
danakj
2015/01/26 21:04:32
magic number duplication, i'd maybe not do this
Stephen White
2015/01/26 22:39:51
Good idea. In fact, there's no reason for an upper
| |
| 597 } else { | |
| 598 gpu_rasterization_msaa_sample_count_ = 0; | |
| 599 } | |
| 600 | |
| 589 if (command_line.HasSwitch(switches::kDisableDistanceFieldText)) { | 601 if (command_line.HasSwitch(switches::kDisableDistanceFieldText)) { |
| 590 is_distance_field_text_enabled_ = false; | 602 is_distance_field_text_enabled_ = false; |
| 591 } else if (command_line.HasSwitch(switches::kEnableDistanceFieldText)) { | 603 } else if (command_line.HasSwitch(switches::kEnableDistanceFieldText)) { |
| 592 is_distance_field_text_enabled_ = true; | 604 is_distance_field_text_enabled_ = true; |
| 593 } else { | 605 } else { |
| 594 is_distance_field_text_enabled_ = false; | 606 is_distance_field_text_enabled_ = false; |
| 595 } | 607 } |
| 596 | 608 |
| 597 // Note that under Linux, the media library will normally already have | 609 // Note that under Linux, the media library will normally already have |
| 598 // been initialized by the Zygote before this instance became a Renderer. | 610 // been initialized by the Zygote before this instance became a Renderer. |
| (...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1335 } | 1347 } |
| 1336 | 1348 |
| 1337 bool RenderThreadImpl::IsGpuRasterizationForced() { | 1349 bool RenderThreadImpl::IsGpuRasterizationForced() { |
| 1338 return is_gpu_rasterization_forced_; | 1350 return is_gpu_rasterization_forced_; |
| 1339 } | 1351 } |
| 1340 | 1352 |
| 1341 bool RenderThreadImpl::IsGpuRasterizationEnabled() { | 1353 bool RenderThreadImpl::IsGpuRasterizationEnabled() { |
| 1342 return is_gpu_rasterization_enabled_; | 1354 return is_gpu_rasterization_enabled_; |
| 1343 } | 1355 } |
| 1344 | 1356 |
| 1357 int RenderThreadImpl::GpuRasterizationMSAASampleCount() { | |
| 1358 return gpu_rasterization_msaa_sample_count_; | |
| 1359 } | |
| 1360 | |
| 1345 bool RenderThreadImpl::IsLcdTextEnabled() { | 1361 bool RenderThreadImpl::IsLcdTextEnabled() { |
| 1346 return is_lcd_text_enabled_; | 1362 return is_lcd_text_enabled_; |
| 1347 } | 1363 } |
| 1348 | 1364 |
| 1349 bool RenderThreadImpl::IsDistanceFieldTextEnabled() { | 1365 bool RenderThreadImpl::IsDistanceFieldTextEnabled() { |
| 1350 return is_distance_field_text_enabled_; | 1366 return is_distance_field_text_enabled_; |
| 1351 } | 1367 } |
| 1352 | 1368 |
| 1353 bool RenderThreadImpl::IsZeroCopyEnabled() { | 1369 bool RenderThreadImpl::IsZeroCopyEnabled() { |
| 1354 return is_zero_copy_enabled_; | 1370 return is_zero_copy_enabled_; |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1775 hidden_widget_count_--; | 1791 hidden_widget_count_--; |
| 1776 | 1792 |
| 1777 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { | 1793 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { |
| 1778 return; | 1794 return; |
| 1779 } | 1795 } |
| 1780 | 1796 |
| 1781 ScheduleIdleHandler(kLongIdleHandlerDelayMs); | 1797 ScheduleIdleHandler(kLongIdleHandlerDelayMs); |
| 1782 } | 1798 } |
| 1783 | 1799 |
| 1784 } // namespace content | 1800 } // namespace content |
| OLD | NEW |