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

Unified Diff: content/browser/compositor/gpu_process_transport_factory.cc

Issue 2286273003: Make cc::Display not own its BeginFrameSource (Closed)
Patch Set: Fix webview Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/test/test_delegating_output_surface.cc ('k') | content/browser/renderer_host/compositor_impl_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/compositor/gpu_process_transport_factory.cc
diff --git a/content/browser/compositor/gpu_process_transport_factory.cc b/content/browser/compositor/gpu_process_transport_factory.cc
index 6e94f4867cd31d5f7bed294e0892d3544e709427..3623b18edd7b441d1d2f34cc8b96bea00713f36b 100644
--- a/content/browser/compositor/gpu_process_transport_factory.cc
+++ b/content/browser/compositor/gpu_process_transport_factory.cc
@@ -165,7 +165,7 @@ namespace content {
struct GpuProcessTransportFactory::PerCompositorData {
gpu::SurfaceHandle surface_handle = gpu::kNullSurfaceHandle;
BrowserCompositorOutputSurface* display_output_surface = nullptr;
- cc::SyntheticBeginFrameSource* begin_frame_source = nullptr;
+ std::unique_ptr<cc::SyntheticBeginFrameSource> begin_frame_source;
ReflectorImpl* reflector = nullptr;
std::unique_ptr<cc::Display> display;
bool output_is_secure = false;
@@ -528,7 +528,6 @@ void GpuProcessTransportFactory::EstablishedGpuChannel(
}
data->display_output_surface = display_output_surface.get();
- data->begin_frame_source = begin_frame_source.get();
if (data->reflector)
data->reflector->OnSourceSurfaceReady(data->display_output_surface);
@@ -543,13 +542,16 @@ void GpuProcessTransportFactory::EstablishedGpuChannel(
// The Display owns and uses the |display_output_surface| created above.
data->display = base::MakeUnique<cc::Display>(
- HostSharedBitmapManager::current(),
- GetGpuMemoryBufferManager(),
- compositor->GetRendererSettings(), std::move(begin_frame_source),
+ HostSharedBitmapManager::current(), GetGpuMemoryBufferManager(),
+ compositor->GetRendererSettings(), begin_frame_source.get(),
std::move(display_output_surface), std::move(scheduler),
base::MakeUnique<cc::TextureMailboxDeleter>(
compositor->task_runner().get()));
+ // Initialize this after the display as the previous display had a reference
+ // to the previous BFS.
+ data->begin_frame_source = std::move(begin_frame_source);
+
// The |delegated_output_surface| is given back to the compositor, it
// delegates to the Display as its root surface. Importantly, it shares the
// same ContextProvider as the Display's output surface.
« no previous file with comments | « cc/test/test_delegating_output_surface.cc ('k') | content/browser/renderer_host/compositor_impl_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698