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

Side by Side Diff: content/browser/compositor/gpu_process_transport_factory.h

Issue 2083853002: exo: Recreate Surface resources on context lost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix nits Created 4 years, 6 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 #ifndef CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_ 5 #ifndef CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_
6 #define CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_ 6 #define CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 gfx::BufferUsage usage) override; 60 gfx::BufferUsage usage) override;
61 cc::SharedBitmapManager* GetSharedBitmapManager() override; 61 cc::SharedBitmapManager* GetSharedBitmapManager() override;
62 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; 62 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override;
63 cc::TaskGraphRunner* GetTaskGraphRunner() override; 63 cc::TaskGraphRunner* GetTaskGraphRunner() override;
64 std::unique_ptr<cc::SurfaceIdAllocator> CreateSurfaceIdAllocator() override; 64 std::unique_ptr<cc::SurfaceIdAllocator> CreateSurfaceIdAllocator() override;
65 void ResizeDisplay(ui::Compositor* compositor, 65 void ResizeDisplay(ui::Compositor* compositor,
66 const gfx::Size& size) override; 66 const gfx::Size& size) override;
67 void SetAuthoritativeVSyncInterval(ui::Compositor* compositor, 67 void SetAuthoritativeVSyncInterval(ui::Compositor* compositor,
68 base::TimeDelta interval) override; 68 base::TimeDelta interval) override;
69 void SetOutputIsSecure(ui::Compositor* compositor, bool secure) override; 69 void SetOutputIsSecure(ui::Compositor* compositor, bool secure) override;
70 void AddObserver(ui::ContextFactoryObserver* observer) override;
71 void RemoveObserver(ui::ContextFactoryObserver* observer) override;
70 72
71 // ImageTransportFactory implementation. 73 // ImageTransportFactory implementation.
72 ui::ContextFactory* GetContextFactory() override; 74 ui::ContextFactory* GetContextFactory() override;
73 cc::SurfaceManager* GetSurfaceManager() override; 75 cc::SurfaceManager* GetSurfaceManager() override;
74 display_compositor::GLHelper* GetGLHelper() override; 76 display_compositor::GLHelper* GetGLHelper() override;
75 void AddObserver(ImageTransportFactoryObserver* observer) override;
76 void RemoveObserver(ImageTransportFactoryObserver* observer) override;
77 #if defined(OS_MACOSX) 77 #if defined(OS_MACOSX)
78 void SetCompositorSuspendedForRecycle(ui::Compositor* compositor, 78 void SetCompositorSuspendedForRecycle(ui::Compositor* compositor,
79 bool suspended) override; 79 bool suspended) override;
80 #endif 80 #endif
81 81
82 private: 82 private:
83 struct PerCompositorData; 83 struct PerCompositorData;
84 84
85 PerCompositorData* CreatePerCompositorData(ui::Compositor* compositor); 85 PerCompositorData* CreatePerCompositorData(ui::Compositor* compositor);
86 std::unique_ptr<cc::SoftwareOutputDevice> CreateSoftwareOutputDevice( 86 std::unique_ptr<cc::SoftwareOutputDevice> CreateSoftwareOutputDevice(
87 ui::Compositor* compositor); 87 ui::Compositor* compositor);
88 void EstablishedGpuChannel(base::WeakPtr<ui::Compositor> compositor, 88 void EstablishedGpuChannel(base::WeakPtr<ui::Compositor> compositor,
89 bool create_gpu_output_surface, 89 bool create_gpu_output_surface,
90 int num_attempts); 90 int num_attempts);
91 91
92 void OnLostMainThreadSharedContextInsideCallback(); 92 void OnLostMainThreadSharedContextInsideCallback();
93 void OnLostMainThreadSharedContext(); 93 void OnLostMainThreadSharedContext();
94 94
95 scoped_refptr<cc::VulkanInProcessContextProvider> 95 scoped_refptr<cc::VulkanInProcessContextProvider>
96 SharedVulkanContextProvider(); 96 SharedVulkanContextProvider();
97 97
98 typedef std::map<ui::Compositor*, PerCompositorData*> PerCompositorDataMap; 98 typedef std::map<ui::Compositor*, PerCompositorData*> PerCompositorDataMap;
99 PerCompositorDataMap per_compositor_data_; 99 PerCompositorDataMap per_compositor_data_;
100 scoped_refptr<ContextProviderCommandBuffer> shared_main_thread_contexts_; 100 scoped_refptr<ContextProviderCommandBuffer> shared_main_thread_contexts_;
101 std::unique_ptr<display_compositor::GLHelper> gl_helper_; 101 std::unique_ptr<display_compositor::GLHelper> gl_helper_;
102 base::ObserverList<ImageTransportFactoryObserver> observer_list_; 102 base::ObserverList<ui::ContextFactoryObserver> observer_list_;
103 std::unique_ptr<cc::SurfaceManager> surface_manager_; 103 std::unique_ptr<cc::SurfaceManager> surface_manager_;
104 uint32_t next_surface_id_namespace_; 104 uint32_t next_surface_id_namespace_;
105 std::unique_ptr<cc::SingleThreadTaskGraphRunner> task_graph_runner_; 105 std::unique_ptr<cc::SingleThreadTaskGraphRunner> task_graph_runner_;
106 scoped_refptr<ContextProviderCommandBuffer> shared_worker_context_provider_; 106 scoped_refptr<ContextProviderCommandBuffer> shared_worker_context_provider_;
107 107
108 bool shared_vulkan_context_provider_initialized_ = false; 108 bool shared_vulkan_context_provider_initialized_ = false;
109 scoped_refptr<cc::VulkanInProcessContextProvider> 109 scoped_refptr<cc::VulkanInProcessContextProvider>
110 shared_vulkan_context_provider_; 110 shared_vulkan_context_provider_;
111 111
112 #if defined(OS_WIN) 112 #if defined(OS_WIN)
113 std::unique_ptr<OutputDeviceBacking> software_backing_; 113 std::unique_ptr<OutputDeviceBacking> software_backing_;
114 #endif 114 #endif
115 base::WeakPtrFactory<GpuProcessTransportFactory> callback_factory_; 115 base::WeakPtrFactory<GpuProcessTransportFactory> callback_factory_;
116 116
117 DISALLOW_COPY_AND_ASSIGN(GpuProcessTransportFactory); 117 DISALLOW_COPY_AND_ASSIGN(GpuProcessTransportFactory);
118 }; 118 };
119 119
120 } // namespace content 120 } // namespace content
121 121
122 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_ 122 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_PROCESS_TRANSPORT_FACTORY_H_
OLDNEW
« no previous file with comments | « components/exo/surface_unittest.cc ('k') | content/browser/compositor/gpu_process_transport_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698