Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(324)

Side by Side Diff: content/renderer/render_thread_impl.cc

Issue 1418573002: cc: Add image decode control in the compositor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 735 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 base::Bind(&RenderThreadImpl::OnMemoryPressure, base::Unretained(this)))); 746 base::Bind(&RenderThreadImpl::OnMemoryPressure, base::Unretained(this))));
747 747
748 int num_raster_threads = 0; 748 int num_raster_threads = 0;
749 std::string string_value = 749 std::string string_value =
750 command_line.GetSwitchValueASCII(switches::kNumRasterThreads); 750 command_line.GetSwitchValueASCII(switches::kNumRasterThreads);
751 bool parsed_num_raster_threads = 751 bool parsed_num_raster_threads =
752 base::StringToInt(string_value, &num_raster_threads); 752 base::StringToInt(string_value, &num_raster_threads);
753 DCHECK(parsed_num_raster_threads) << string_value; 753 DCHECK(parsed_num_raster_threads) << string_value;
754 DCHECK_GT(num_raster_threads, 0); 754 DCHECK_GT(num_raster_threads, 0);
755 755
756 #if defined(OS_ANDROID)
756 // Note: Currently, enabling image decode tasks only provides a benefit if 757 // Note: Currently, enabling image decode tasks only provides a benefit if
757 // there's more than one raster thread. This might change in the future but we 758 // we use high quality interpolation filters, which are disabled on android.
758 // avoid it for now to reduce the cost of recording. 759 are_image_decode_tasks_enabled_ = false;
759 are_image_decode_tasks_enabled_ = num_raster_threads > 1; 760 #else
761 are_image_decode_tasks_enabled_ = true;
762 #endif
760 763
761 base::SimpleThread::Options thread_options; 764 base::SimpleThread::Options thread_options;
762 #if defined(OS_ANDROID) || defined(OS_LINUX) 765 #if defined(OS_ANDROID) || defined(OS_LINUX)
763 if (!command_line.HasSwitch( 766 if (!command_line.HasSwitch(
764 switches::kUseNormalPriorityForTileTaskWorkerThreads)) { 767 switches::kUseNormalPriorityForTileTaskWorkerThreads)) {
765 thread_options.set_priority(base::ThreadPriority::BACKGROUND); 768 thread_options.set_priority(base::ThreadPriority::BACKGROUND);
766 } 769 }
767 #endif 770 #endif
768 771
769 raster_worker_pool_->Start(num_raster_threads, thread_options); 772 raster_worker_pool_->Start(num_raster_threads, thread_options);
(...skipping 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after
1992 1995
1993 void RenderThreadImpl::ReleaseFreeMemory() { 1996 void RenderThreadImpl::ReleaseFreeMemory() {
1994 base::allocator::ReleaseFreeMemory(); 1997 base::allocator::ReleaseFreeMemory();
1995 discardable_shared_memory_manager()->ReleaseFreeMemory(); 1998 discardable_shared_memory_manager()->ReleaseFreeMemory();
1996 1999
1997 if (blink_platform_impl_) 2000 if (blink_platform_impl_)
1998 blink::decommitFreeableMemory(); 2001 blink::decommitFreeableMemory();
1999 } 2002 }
2000 2003
2001 } // namespace content 2004 } // namespace content
OLDNEW
« cc/playback/discardable_image_map.cc ('K') | « cc/trees/layer_tree_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698