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 <utility> | 10 #include <utility> |
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 base::Bind(&RenderThreadImpl::OnMemoryPressure, base::Unretained(this)))); | 810 base::Bind(&RenderThreadImpl::OnMemoryPressure, base::Unretained(this)))); |
811 | 811 |
812 int num_raster_threads = 0; | 812 int num_raster_threads = 0; |
813 std::string string_value = | 813 std::string string_value = |
814 command_line.GetSwitchValueASCII(switches::kNumRasterThreads); | 814 command_line.GetSwitchValueASCII(switches::kNumRasterThreads); |
815 bool parsed_num_raster_threads = | 815 bool parsed_num_raster_threads = |
816 base::StringToInt(string_value, &num_raster_threads); | 816 base::StringToInt(string_value, &num_raster_threads); |
817 DCHECK(parsed_num_raster_threads) << string_value; | 817 DCHECK(parsed_num_raster_threads) << string_value; |
818 DCHECK_GT(num_raster_threads, 0); | 818 DCHECK_GT(num_raster_threads, 0); |
819 | 819 |
| 820 #if defined(OS_ANDROID) |
820 // Note: Currently, enabling image decode tasks only provides a benefit if | 821 // Note: Currently, enabling image decode tasks only provides a benefit if |
821 // there's more than one raster thread. This might change in the future but we | 822 // we use high quality interpolation filters, which are disabled on android. |
822 // avoid it for now to reduce the cost of recording. | 823 are_image_decode_tasks_enabled_ = false; |
823 are_image_decode_tasks_enabled_ = num_raster_threads > 1; | 824 #else |
| 825 are_image_decode_tasks_enabled_ = true; |
| 826 #endif |
824 | 827 |
825 base::SimpleThread::Options thread_options; | 828 base::SimpleThread::Options thread_options; |
826 #if defined(OS_ANDROID) || defined(OS_LINUX) | 829 #if defined(OS_ANDROID) || defined(OS_LINUX) |
827 if (!command_line.HasSwitch( | 830 if (!command_line.HasSwitch( |
828 switches::kUseNormalPriorityForTileTaskWorkerThreads)) { | 831 switches::kUseNormalPriorityForTileTaskWorkerThreads)) { |
829 thread_options.set_priority(base::ThreadPriority::BACKGROUND); | 832 thread_options.set_priority(base::ThreadPriority::BACKGROUND); |
830 } | 833 } |
831 #endif | 834 #endif |
832 | 835 |
833 raster_worker_pool_->Start(num_raster_threads, thread_options); | 836 raster_worker_pool_->Start(num_raster_threads, thread_options); |
(...skipping 1277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2111 } | 2114 } |
2112 | 2115 |
2113 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { | 2116 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { |
2114 size_t erased = | 2117 size_t erased = |
2115 RenderThreadImpl::current()->pending_render_frame_connects_.erase( | 2118 RenderThreadImpl::current()->pending_render_frame_connects_.erase( |
2116 routing_id_); | 2119 routing_id_); |
2117 DCHECK_EQ(1u, erased); | 2120 DCHECK_EQ(1u, erased); |
2118 } | 2121 } |
2119 | 2122 |
2120 } // namespace content | 2123 } // namespace content |
OLD | NEW |