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

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

Issue 2480203002: ui: Cleanup class/struct forward declarations (Closed)
Patch Set: Sync CL to position 430550 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 2457eaef2925f40e7241def67cbd9667dd6f98ad..c922d8a282eaa0c2ceea12ae5ec23c70380f2edb 100644
--- a/content/browser/renderer_host/delegated_frame_host.cc
+++ b/content/browser/renderer_host/delegated_frame_host.cc
@@ -82,6 +82,8 @@ DelegatedFrameHost::DelegatedFrameHost(const cc::FrameSinkId& frame_sink_id,
factory->GetSurfaceManager()->RegisterFrameSinkId(frame_sink_id_);
factory->GetSurfaceManager()->RegisterSurfaceFactoryClient(frame_sink_id_,
this);
+ surface_factory_ = base::MakeUnique<cc::SurfaceFactory>(
+ frame_sink_id_, factory->GetSurfaceManager(), this);
}
void DelegatedFrameHost::WasShown(const ui::LatencyInfo& latency_info) {
@@ -387,7 +389,7 @@ void DelegatedFrameHost::AttemptFrameSubscriberCapture(
subscriber_texture->target()));
}
- if (surface_factory_.get()) {
+ if (!local_frame_id_.is_null()) {
// To avoid unnecessary composites, go directly to the Surface rather than
// through RequestCopyOfOutput (which goes through the browser
// compositor).
@@ -456,7 +458,7 @@ void DelegatedFrameHost::SwapDelegatedFrame(uint32_t compositor_frame_sink_id,
// the DelegatedRendererLayer.
EvictDelegatedFrame();
- surface_factory_.reset();
+ surface_factory_->Reset();
if (!surface_returned_resources_.empty()) {
SendReclaimCompositorResources(last_compositor_frame_sink_id_,
false /* is_swap_ack */);
@@ -474,10 +476,6 @@ void DelegatedFrameHost::SwapDelegatedFrame(uint32_t compositor_frame_sink_id,
} else {
ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
cc::SurfaceManager* manager = factory->GetSurfaceManager();
- if (!surface_factory_) {
- surface_factory_ =
- base::MakeUnique<cc::SurfaceFactory>(frame_sink_id_, manager, this);
- }
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())
« no previous file with comments | « content/browser/renderer_host/compositor_impl_android.cc ('k') | content/browser/renderer_host/input/input_router_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698