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

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 270333003: cc: Do not limit number of raster tasks for upload limit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed TileManagerPerfTest Created 6 years, 7 months 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 | Annotate | Revision Log
« no previous file with comments | « cc/test/test_web_graphics_context_3d.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 "cc/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 const size_t kMaxBytesUploadedPerMs = 1024 * 1024 * 2; 96 const size_t kMaxBytesUploadedPerMs = 1024 * 1024 * 2;
97 // Assuming a two frame deep pipeline between CPU and GPU and we are 97 // Assuming a two frame deep pipeline between CPU and GPU and we are
98 // drawing 60 frames per second which would require us to draw one 98 // drawing 60 frames per second which would require us to draw one
99 // frame in 16 milliseconds. 99 // frame in 16 milliseconds.
100 const size_t kMaxTransferBufferUsageBytes = 16 * 2 * kMaxBytesUploadedPerMs; 100 const size_t kMaxTransferBufferUsageBytes = 16 * 2 * kMaxBytesUploadedPerMs;
101 return std::min( 101 return std::min(
102 context_provider->ContextCapabilities().max_transfer_buffer_usage_bytes, 102 context_provider->ContextCapabilities().max_transfer_buffer_usage_bytes,
103 kMaxTransferBufferUsageBytes); 103 kMaxTransferBufferUsageBytes);
104 } 104 }
105 105
106 size_t GetMaxRasterTasksUsageBytes(cc::ContextProvider* context_provider) {
107 // Transfer-buffer/raster-tasks limits are different but related. We make
108 // equal here, as this is ideal when using transfer buffers. When not using
109 // transfer buffers we should still limit raster to something similar, to
110 // preserve caching behavior (and limit memory waste when priorities change).
111 return GetMaxTransferBufferUsageBytes(context_provider);
112 }
113
114 unsigned GetMapImageTextureTarget(cc::ContextProvider* context_provider) { 106 unsigned GetMapImageTextureTarget(cc::ContextProvider* context_provider) {
115 if (!context_provider) 107 if (!context_provider)
116 return GL_TEXTURE_2D; 108 return GL_TEXTURE_2D;
117 109
118 if (context_provider->ContextCapabilities().gpu.egl_image_external) 110 if (context_provider->ContextCapabilities().gpu.egl_image_external)
119 return GL_TEXTURE_EXTERNAL_OES; 111 return GL_TEXTURE_EXTERNAL_OES;
120 if (context_provider->ContextCapabilities().gpu.texture_rectangle) 112 if (context_provider->ContextCapabilities().gpu.texture_rectangle)
121 return GL_TEXTURE_RECTANGLE_ARB; 113 return GL_TEXTURE_RECTANGLE_ARB;
122 114
123 return GL_TEXTURE_2D; 115 return GL_TEXTURE_2D;
(...skipping 1774 matching lines...) Expand 10 before | Expand all | Expand 10 after
1898 GL_TEXTURE_2D, 1890 GL_TEXTURE_2D,
1899 resource_provider->memory_efficient_texture_format()); 1891 resource_provider->memory_efficient_texture_format());
1900 } 1892 }
1901 direct_raster_worker_pool_ = DirectRasterWorkerPool::Create( 1893 direct_raster_worker_pool_ = DirectRasterWorkerPool::Create(
1902 proxy_->ImplThreadTaskRunner(), resource_provider, context_provider); 1894 proxy_->ImplThreadTaskRunner(), resource_provider, context_provider);
1903 tile_manager_ = 1895 tile_manager_ =
1904 TileManager::Create(this, 1896 TileManager::Create(this,
1905 resource_pool_.get(), 1897 resource_pool_.get(),
1906 raster_worker_pool_->AsRasterizer(), 1898 raster_worker_pool_->AsRasterizer(),
1907 direct_raster_worker_pool_->AsRasterizer(), 1899 direct_raster_worker_pool_->AsRasterizer(),
1908 GetMaxRasterTasksUsageBytes(context_provider),
1909 allow_rasterize_on_demand, 1900 allow_rasterize_on_demand,
1910 rendering_stats_instrumentation_); 1901 rendering_stats_instrumentation_);
1911 1902
1912 UpdateTileManagerMemoryPolicy(ActualManagedMemoryPolicy()); 1903 UpdateTileManagerMemoryPolicy(ActualManagedMemoryPolicy());
1913 need_to_update_visible_tiles_before_draw_ = false; 1904 need_to_update_visible_tiles_before_draw_ = false;
1914 } 1905 }
1915 1906
1916 void LayerTreeHostImpl::EnforceZeroBudget(bool zero_budget) { 1907 void LayerTreeHostImpl::EnforceZeroBudget(bool zero_budget) {
1917 SetManagedMemoryPolicy(cached_managed_memory_policy_, zero_budget); 1908 SetManagedMemoryPolicy(cached_managed_memory_policy_, zero_budget);
1918 } 1909 }
(...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after
3146 swap_promise_monitor_.erase(monitor); 3137 swap_promise_monitor_.erase(monitor);
3147 } 3138 }
3148 3139
3149 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { 3140 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() {
3150 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); 3141 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin();
3151 for (; it != swap_promise_monitor_.end(); it++) 3142 for (; it != swap_promise_monitor_.end(); it++)
3152 (*it)->OnSetNeedsRedrawOnImpl(); 3143 (*it)->OnSetNeedsRedrawOnImpl();
3153 } 3144 }
3154 3145
3155 } // namespace cc 3146 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/test_web_graphics_context_3d.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698