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

Unified Diff: content/browser/renderer_host/delegated_frame_host.cc

Issue 2485473003: Remove SurfaceFactory::Create and SurfaceFactory::Destroy (Closed)
Patch Set: fixed windows compile error Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/delegated_frame_host.cc
diff --git a/content/browser/renderer_host/delegated_frame_host.cc b/content/browser/renderer_host/delegated_frame_host.cc
index 9505792fd0c14a225865dafd7ca08cd099daf730..9320a19ed061c0407122b281b35e1b58b658653a 100644
--- a/content/browser/renderer_host/delegated_frame_host.cc
+++ b/content/browser/renderer_host/delegated_frame_host.cc
@@ -396,8 +396,7 @@ void DelegatedFrameHost::AttemptFrameSubscriberCapture(
if (!request_copy_of_output_callback_for_testing_.is_null())
request_copy_of_output_callback_for_testing_.Run(std::move(request));
else
- surface_factory_->RequestCopyOfSurface(local_frame_id_,
- std::move(request));
+ surface_factory_->RequestCopyOfSurface(std::move(request));
} else {
request->set_area(gfx::Rect(current_frame_size_in_dip_));
RequestCopyOfOutput(std::move(request));
@@ -478,10 +477,10 @@ void DelegatedFrameHost::SwapDelegatedFrame(uint32_t compositor_frame_sink_id,
cc::SurfaceManager* manager = factory->GetSurfaceManager();
if (!local_frame_id_.is_valid() || frame_size != current_surface_size_ ||
frame_size_in_dip != current_frame_size_in_dip_) {
- if (local_frame_id_.is_valid())
- surface_factory_->Destroy(local_frame_id_);
local_frame_id_ = id_allocator_->GenerateId();
- surface_factory_->Create(local_frame_id_);
+ surface_factory_->SubmitCompositorFrame(
Fady Samuel 2016/11/21 21:00:16 Please don't land this. This is not the correct fi
+ local_frame_id_, cc::CompositorFrame(),
+ cc::SurfaceFactory::DrawCallback());
// manager must outlive compositors using it.
client_->DelegatedFrameHostGetLayer()->SetShowSurface(
cc::SurfaceId(frame_sink_id_, local_frame_id_),
@@ -593,7 +592,7 @@ void DelegatedFrameHost::SetBeginFrameSource(
void DelegatedFrameHost::EvictDelegatedFrame() {
client_->DelegatedFrameHostGetLayer()->SetShowSolidColorContent();
if (local_frame_id_.is_valid()) {
- surface_factory_->Destroy(local_frame_id_);
+ surface_factory_->EvictSurface();
local_frame_id_ = cc::LocalFrameId();
}
delegated_frame_evictor_->DiscardedFrame();
@@ -827,9 +826,7 @@ DelegatedFrameHost::~DelegatedFrameHost() {
DCHECK(!compositor_);
ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
factory->GetContextFactory()->RemoveObserver(this);
-
- if (local_frame_id_.is_valid())
- surface_factory_->Destroy(local_frame_id_);
+ surface_factory_->EvictSurface();
factory->GetSurfaceManager()->UnregisterSurfaceFactoryClient(frame_sink_id_);
factory->GetSurfaceManager()->InvalidateFrameSinkId(frame_sink_id_);

Powered by Google App Engine
This is Rietveld 408576698