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

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

Issue 151093005: cc: Update Main RendererCapabilities on DeferredInitialize (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add back a DCHECK that was accdentially deleted Created 6 years, 10 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/thread_proxy.h ('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/thread_proxy.h" 5 #include "cc/trees/thread_proxy.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 base::Passed(&output_surface), 331 base::Passed(&output_surface),
332 offscreen_context_provider, 332 offscreen_context_provider,
333 &success, 333 &success,
334 &capabilities)); 334 &capabilities));
335 completion.Wait(); 335 completion.Wait();
336 } 336 }
337 337
338 OnOutputSurfaceInitializeAttempted(success, capabilities); 338 OnOutputSurfaceInitializeAttempted(success, capabilities);
339 } 339 }
340 340
341 void ThreadProxy::SetRendererCapabilitiesMainThreadCopy(
342 const RendererCapabilities& capabilities) {
343 main().renderer_capabilities_main_thread_copy = capabilities;
344 }
345
341 void ThreadProxy::OnOutputSurfaceInitializeAttempted( 346 void ThreadProxy::OnOutputSurfaceInitializeAttempted(
342 bool success, 347 bool success,
343 const RendererCapabilities& capabilities) { 348 const RendererCapabilities& capabilities) {
344 DCHECK(IsMainThread()); 349 DCHECK(IsMainThread());
345 DCHECK(layer_tree_host()); 350 DCHECK(layer_tree_host());
346 351
347 if (success) { 352 if (success) {
348 main().renderer_capabilities_main_thread_copy = capabilities; 353 main().renderer_capabilities_main_thread_copy = capabilities;
349 } 354 }
350 355
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 main().can_cancel_commit = false; 409 main().can_cancel_commit = false;
405 410
406 if (main().commit_requested) 411 if (main().commit_requested)
407 return; 412 return;
408 TRACE_EVENT0("cc", "ThreadProxy::SetNeedsCommit"); 413 TRACE_EVENT0("cc", "ThreadProxy::SetNeedsCommit");
409 main().commit_requested = true; 414 main().commit_requested = true;
410 415
411 SendCommitRequestToImplThreadIfNeeded(); 416 SendCommitRequestToImplThreadIfNeeded();
412 } 417 }
413 418
419 void ThreadProxy::UpdateRendererCapabilitiesOnImplThread() {
420 DCHECK(IsImplThread());
421 Proxy::MainThreadTaskRunner()->PostTask(
422 FROM_HERE,
423 base::Bind(&ThreadProxy::SetRendererCapabilitiesMainThreadCopy,
424 main_thread_weak_ptr_,
425 impl()
426 .layer_tree_host_impl->GetRendererCapabilities()
427 .MainThreadCapabilities()));
428 }
429
414 void ThreadProxy::DidLoseOutputSurfaceOnImplThread() { 430 void ThreadProxy::DidLoseOutputSurfaceOnImplThread() {
415 TRACE_EVENT0("cc", "ThreadProxy::DidLoseOutputSurfaceOnImplThread"); 431 TRACE_EVENT0("cc", "ThreadProxy::DidLoseOutputSurfaceOnImplThread");
416 DCHECK(IsImplThread()); 432 DCHECK(IsImplThread());
417 CheckOutputSurfaceStatusOnImplThread(); 433 CheckOutputSurfaceStatusOnImplThread();
418 } 434 }
419 435
420 void ThreadProxy::CheckOutputSurfaceStatusOnImplThread() { 436 void ThreadProxy::CheckOutputSurfaceStatusOnImplThread() {
421 TRACE_EVENT0("cc", "ThreadProxy::CheckOutputSurfaceStatusOnImplThread"); 437 TRACE_EVENT0("cc", "ThreadProxy::CheckOutputSurfaceStatusOnImplThread");
422 DCHECK(IsImplThread()); 438 DCHECK(IsImplThread());
423 if (!impl().layer_tree_host_impl->IsContextLost()) 439 if (!impl().layer_tree_host_impl->IsContextLost())
(...skipping 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after
1714 impl().commit_to_activate_duration_history.InsertSample( 1730 impl().commit_to_activate_duration_history.InsertSample(
1715 base::TimeTicks::HighResNow() - impl().commit_complete_time); 1731 base::TimeTicks::HighResNow() - impl().commit_complete_time);
1716 } 1732 }
1717 1733
1718 void ThreadProxy::DidManageTiles() { 1734 void ThreadProxy::DidManageTiles() {
1719 DCHECK(IsImplThread()); 1735 DCHECK(IsImplThread());
1720 impl().scheduler->DidManageTiles(); 1736 impl().scheduler->DidManageTiles();
1721 } 1737 }
1722 1738
1723 } // namespace cc 1739 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/thread_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698