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

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

Issue 1149803002: cc: Make single-thread renderer compositor always synchronous. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: syncsinglethread: . Created 5 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
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_pixeltest_synchronous.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 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 2100 matching lines...) Expand 10 before | Expand all | Expand 10 after
2111 2111
2112 if (GetRendererCapabilities().using_image) { 2112 if (GetRendererCapabilities().using_image) {
2113 unsigned image_target = settings_.use_image_texture_target; 2113 unsigned image_target = settings_.use_image_texture_target;
2114 DCHECK_IMPLIES( 2114 DCHECK_IMPLIES(
2115 image_target == GL_TEXTURE_RECTANGLE_ARB, 2115 image_target == GL_TEXTURE_RECTANGLE_ARB,
2116 context_provider->ContextCapabilities().gpu.texture_rectangle); 2116 context_provider->ContextCapabilities().gpu.texture_rectangle);
2117 DCHECK_IMPLIES( 2117 DCHECK_IMPLIES(
2118 image_target == GL_TEXTURE_EXTERNAL_OES, 2118 image_target == GL_TEXTURE_EXTERNAL_OES,
2119 context_provider->ContextCapabilities().gpu.egl_image_external); 2119 context_provider->ContextCapabilities().gpu.egl_image_external);
2120 2120
2121 if (settings_.use_zero_copy || IsSynchronousSingleThreaded()) { 2121 if (settings_.use_zero_copy) {
2122 *resource_pool = 2122 *resource_pool =
2123 ResourcePool::Create(resource_provider_.get(), image_target); 2123 ResourcePool::Create(resource_provider_.get(), image_target);
2124 2124
2125 *tile_task_worker_pool = ZeroCopyTileTaskWorkerPool::Create( 2125 *tile_task_worker_pool = ZeroCopyTileTaskWorkerPool::Create(
2126 task_runner, task_graph_runner, resource_provider_.get()); 2126 task_runner, task_graph_runner, resource_provider_.get());
2127 return; 2127 return;
2128 } 2128 }
2129 2129
2130 if (settings_.use_one_copy) { 2130 if (settings_.use_one_copy) {
2131 // Synchronous single-threaded mode depends on tiles being ready to
2132 // draw when raster is complete. Therefore, it must use one of zero
2133 // copy, software raster, or GPU raster.
2134 DCHECK(!IsSynchronousSingleThreaded());
2135
2131 // We need to create a staging resource pool when using copy rasterizer. 2136 // We need to create a staging resource pool when using copy rasterizer.
2132 *staging_resource_pool = 2137 *staging_resource_pool =
2133 ResourcePool::Create(resource_provider_.get(), image_target); 2138 ResourcePool::Create(resource_provider_.get(), image_target);
2134 *resource_pool = 2139 *resource_pool =
2135 ResourcePool::Create(resource_provider_.get(), GL_TEXTURE_2D); 2140 ResourcePool::Create(resource_provider_.get(), GL_TEXTURE_2D);
2136 2141
2137 *tile_task_worker_pool = OneCopyTileTaskWorkerPool::Create( 2142 *tile_task_worker_pool = OneCopyTileTaskWorkerPool::Create(
2138 task_runner, task_graph_runner, context_provider, 2143 task_runner, task_graph_runner, context_provider,
2139 resource_provider_.get(), staging_resource_pool_.get()); 2144 resource_provider_.get(), staging_resource_pool_.get());
2140 return; 2145 return;
(...skipping 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after
3436 new_target.SetToMin(layer_impl->MaxScrollOffset()); 3441 new_target.SetToMin(layer_impl->MaxScrollOffset());
3437 3442
3438 curve->UpdateTarget( 3443 curve->UpdateTarget(
3439 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time) 3444 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time)
3440 .InSecondsF(), 3445 .InSecondsF(),
3441 new_target); 3446 new_target);
3442 3447
3443 return true; 3448 return true;
3444 } 3449 }
3445 } // namespace cc 3450 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_pixeltest_synchronous.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698