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

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

Issue 18454002: Reland "Shouldn't access LayerTreeTest::layer_tree_host on impl thread" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 5 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/trees/layer_tree_host_unittest_animation.cc ('k') | no next file » | 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/single_thread_proxy.h" 5 #include "cc/trees/single_thread_proxy.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "cc/output/context_provider.h" 9 #include "cc/output/context_provider.h"
10 #include "cc/output/output_surface.h" 10 #include "cc/output/output_surface.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 DCHECK(Proxy::IsMainThread()); 89 DCHECK(Proxy::IsMainThread());
90 return layer_tree_host_impl_; 90 return layer_tree_host_impl_;
91 } 91 }
92 92
93 void SingleThreadProxy::SetLayerTreeHostClientReady() { 93 void SingleThreadProxy::SetLayerTreeHostClientReady() {
94 // Scheduling is controlled by the embedder in the single thread case, so 94 // Scheduling is controlled by the embedder in the single thread case, so
95 // nothing to do. 95 // nothing to do.
96 } 96 }
97 97
98 void SingleThreadProxy::SetVisible(bool visible) { 98 void SingleThreadProxy::SetVisible(bool visible) {
99 DebugScopedSetImplThread impl(this); 99 DebugScopedSetImplThreadAndMainThreadBlocked impl(this);
100 layer_tree_host_impl_->SetVisible(visible); 100 layer_tree_host_impl_->SetVisible(visible);
101 } 101 }
102 102
103 void SingleThreadProxy::CreateAndInitializeOutputSurface() { 103 void SingleThreadProxy::CreateAndInitializeOutputSurface() {
104 TRACE_EVENT0( 104 TRACE_EVENT0(
105 "cc", "SingleThreadProxy::CreateAndInitializeOutputSurface"); 105 "cc", "SingleThreadProxy::CreateAndInitializeOutputSurface");
106 DCHECK(Proxy::IsMainThread()); 106 DCHECK(Proxy::IsMainThread());
107 107
108 scoped_ptr<OutputSurface> output_surface = first_output_surface_.Pass(); 108 scoped_ptr<OutputSurface> output_surface = first_output_surface_.Pass();
109 if (!output_surface) 109 if (!output_surface)
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 168
169 void SingleThreadProxy::SetNeedsAnimate() { 169 void SingleThreadProxy::SetNeedsAnimate() {
170 // Thread-only feature. 170 // Thread-only feature.
171 NOTREACHED(); 171 NOTREACHED();
172 } 172 }
173 173
174 void SingleThreadProxy::DoCommit(scoped_ptr<ResourceUpdateQueue> queue) { 174 void SingleThreadProxy::DoCommit(scoped_ptr<ResourceUpdateQueue> queue) {
175 DCHECK(Proxy::IsMainThread()); 175 DCHECK(Proxy::IsMainThread());
176 // Commit immediately. 176 // Commit immediately.
177 { 177 {
178 DebugScopedSetMainThreadBlocked mainThreadBlocked(this); 178 DebugScopedSetImplThreadAndMainThreadBlocked impl_with_main_blocked(this);
179 DebugScopedSetImplThread impl(this);
180
181 RenderingStatsInstrumentation* stats_instrumentation = 179 RenderingStatsInstrumentation* stats_instrumentation =
182 layer_tree_host_->rendering_stats_instrumentation(); 180 layer_tree_host_->rendering_stats_instrumentation();
183 base::TimeTicks start_time = stats_instrumentation->StartRecording(); 181 base::TimeTicks start_time = stats_instrumentation->StartRecording();
184 182
185 layer_tree_host_impl_->BeginCommit(); 183 layer_tree_host_impl_->BeginCommit();
186 184
187 if (layer_tree_host_->contents_texture_manager()) { 185 if (layer_tree_host_->contents_texture_manager()) {
188 layer_tree_host_->contents_texture_manager()-> 186 layer_tree_host_->contents_texture_manager()->
189 PushTexturePrioritiesToBackings(); 187 PushTexturePrioritiesToBackings();
190 } 188 }
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 483
486 bool SingleThreadProxy::CommitPendingForTesting() { return false; } 484 bool SingleThreadProxy::CommitPendingForTesting() { return false; }
487 485
488 skia::RefPtr<SkPicture> SingleThreadProxy::CapturePicture() { 486 skia::RefPtr<SkPicture> SingleThreadProxy::CapturePicture() {
489 // Impl-side painting only. 487 // Impl-side painting only.
490 NOTREACHED(); 488 NOTREACHED();
491 return skia::RefPtr<SkPicture>(); 489 return skia::RefPtr<SkPicture>();
492 } 490 }
493 491
494 } // namespace cc 492 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest_animation.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698