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

Side by Side Diff: content/browser/compositor/delegated_frame_host.cc

Issue 1304063014: cc: Plumbing for BeginFrameSource based on Surfaces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More use-after-free. Attempt to fix mojo. Created 5 years, 2 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/browser/compositor/delegated_frame_host.h" 5 #include "content/browser/compositor/delegated_frame_host.h"
6 6
7 #include "base/callback_helpers.h" 7 #include "base/callback_helpers.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/time/default_tick_clock.h" 9 #include "base/time/default_tick_clock.h"
10 #include "cc/output/compositor_frame.h" 10 #include "cc/output/compositor_frame.h"
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 const cc::ReturnedResourceArray& resources) { 528 const cc::ReturnedResourceArray& resources) {
529 if (resources.empty()) 529 if (resources.empty())
530 return; 530 return;
531 std::copy(resources.begin(), 531 std::copy(resources.begin(),
532 resources.end(), 532 resources.end(),
533 std::back_inserter(surface_returned_resources_)); 533 std::back_inserter(surface_returned_resources_));
534 if (!pending_delegated_ack_count_) 534 if (!pending_delegated_ack_count_)
535 SendReturnedDelegatedResources(last_output_surface_id_); 535 SendReturnedDelegatedResources(last_output_surface_id_);
536 } 536 }
537 537
538 void DelegatedFrameHost::SetBeginFrameSource(
539 cc::BeginFrameSource* begin_frame_source) {
540 // TODO(tansell): Hook this up.
541 }
542
538 void DelegatedFrameHost::EvictDelegatedFrame() { 543 void DelegatedFrameHost::EvictDelegatedFrame() {
539 client_->DelegatedFrameHostGetLayer()->SetShowSolidColorContent(); 544 client_->DelegatedFrameHostGetLayer()->SetShowSolidColorContent();
540 frame_provider_ = NULL; 545 frame_provider_ = NULL;
541 if (!surface_id_.is_null()) { 546 if (!surface_id_.is_null()) {
542 surface_factory_->Destroy(surface_id_); 547 surface_factory_->Destroy(surface_id_);
543 surface_id_ = cc::SurfaceId(); 548 surface_id_ = cc::SurfaceId();
544 } 549 }
545 delegated_frame_evictor_->DiscardedFrame(); 550 delegated_frame_evictor_->DiscardedFrame();
546 } 551 }
547 552
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
1037 cc::SurfaceManager* manager = factory->GetSurfaceManager(); 1042 cc::SurfaceManager* manager = factory->GetSurfaceManager();
1038 new_layer->SetShowSurface( 1043 new_layer->SetShowSurface(
1039 surface_id_, base::Bind(&SatisfyCallback, base::Unretained(manager)), 1044 surface_id_, base::Bind(&SatisfyCallback, base::Unretained(manager)),
1040 base::Bind(&RequireCallback, base::Unretained(manager)), 1045 base::Bind(&RequireCallback, base::Unretained(manager)),
1041 current_surface_size_, current_scale_factor_, 1046 current_surface_size_, current_scale_factor_,
1042 current_frame_size_in_dip_); 1047 current_frame_size_in_dip_);
1043 } 1048 }
1044 } 1049 }
1045 1050
1046 } // namespace content 1051 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698