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

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: SurfaceAggregator tests; fix some bugs revealed by tests Created 5 years, 3 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 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 const cc::ReturnedResourceArray& resources) { 522 const cc::ReturnedResourceArray& resources) {
523 if (resources.empty()) 523 if (resources.empty())
524 return; 524 return;
525 std::copy(resources.begin(), 525 std::copy(resources.begin(),
526 resources.end(), 526 resources.end(),
527 std::back_inserter(surface_returned_resources_)); 527 std::back_inserter(surface_returned_resources_));
528 if (!pending_delegated_ack_count_) 528 if (!pending_delegated_ack_count_)
529 SendReturnedDelegatedResources(last_output_surface_id_); 529 SendReturnedDelegatedResources(last_output_surface_id_);
530 } 530 }
531 531
532 void DelegatedFrameHost::SetBeginFrameSource(
533 cc::BeginFrameSource* begin_frame_source) {
534 // TODO(tansell): Hook this up.
535 }
536
532 void DelegatedFrameHost::EvictDelegatedFrame() { 537 void DelegatedFrameHost::EvictDelegatedFrame() {
533 client_->DelegatedFrameHostGetLayer()->SetShowSolidColorContent(); 538 client_->DelegatedFrameHostGetLayer()->SetShowSolidColorContent();
534 frame_provider_ = NULL; 539 frame_provider_ = NULL;
535 if (!surface_id_.is_null()) { 540 if (!surface_id_.is_null()) {
536 surface_factory_->Destroy(surface_id_); 541 surface_factory_->Destroy(surface_id_);
537 surface_id_ = cc::SurfaceId(); 542 surface_id_ = cc::SurfaceId();
538 } 543 }
539 delegated_frame_evictor_->DiscardedFrame(); 544 delegated_frame_evictor_->DiscardedFrame();
540 } 545 }
541 546
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
1031 cc::SurfaceManager* manager = factory->GetSurfaceManager(); 1036 cc::SurfaceManager* manager = factory->GetSurfaceManager();
1032 new_layer->SetShowSurface( 1037 new_layer->SetShowSurface(
1033 surface_id_, base::Bind(&SatisfyCallback, base::Unretained(manager)), 1038 surface_id_, base::Bind(&SatisfyCallback, base::Unretained(manager)),
1034 base::Bind(&RequireCallback, base::Unretained(manager)), 1039 base::Bind(&RequireCallback, base::Unretained(manager)),
1035 current_surface_size_, current_scale_factor_, 1040 current_surface_size_, current_scale_factor_,
1036 current_frame_size_in_dip_); 1041 current_frame_size_in_dip_);
1037 } 1042 }
1038 } 1043 }
1039 1044
1040 } // namespace content 1045 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698