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

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

Issue 2485473003: Remove SurfaceFactory::Create and SurfaceFactory::Destroy (Closed)
Patch Set: up 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 c922d8a282eaa0c2ceea12ae5ec23c70380f2edb..7401e170ea2bb3f04b7a2a19599413542ba24ceb 100644
--- a/content/browser/renderer_host/delegated_frame_host.cc
+++ b/content/browser/renderer_host/delegated_frame_host.cc
@@ -478,10 +478,10 @@ void DelegatedFrameHost::SwapDelegatedFrame(uint32_t compositor_frame_sink_id,
cc::SurfaceManager* manager = factory->GetSurfaceManager();
if (local_frame_id_.is_null() || frame_size != current_surface_size_ ||
frame_size_in_dip != current_frame_size_in_dip_) {
- if (!local_frame_id_.is_null())
- 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/08 22:23:59 Remove this?
Saman Sami 2016/11/11 17:49:58 Done.
+ 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 +593,6 @@ void DelegatedFrameHost::SetBeginFrameSource(
void DelegatedFrameHost::EvictDelegatedFrame() {
client_->DelegatedFrameHostGetLayer()->SetShowSolidColorContent();
if (!local_frame_id_.is_null()) {
- surface_factory_->Destroy(local_frame_id_);
local_frame_id_ = cc::LocalFrameId();
}
delegated_frame_evictor_->DiscardedFrame();
@@ -828,8 +827,6 @@ DelegatedFrameHost::~DelegatedFrameHost() {
ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
factory->GetContextFactory()->RemoveObserver(this);
- if (!local_frame_id_.is_null())
- surface_factory_->Destroy(local_frame_id_);
factory->GetSurfaceManager()->UnregisterSurfaceFactoryClient(frame_sink_id_);
factory->GetSurfaceManager()->InvalidateFrameSinkId(frame_sink_id_);

Powered by Google App Engine
This is Rietveld 408576698