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

Side by Side Diff: content/gpu/gpu_child_thread.h

Issue 1962493002: Make Mac swap code like other platforms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporate review feedback Created 4 years, 7 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
« no previous file with comments | « content/content_common.gypi ('k') | content/gpu/gpu_child_thread.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_GPU_GPU_CHILD_THREAD_H_ 5 #ifndef CONTENT_GPU_GPU_CHILD_THREAD_H_
6 #define CONTENT_GPU_GPU_CHILD_THREAD_H_ 6 #define CONTENT_GPU_GPU_CHILD_THREAD_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 28 matching lines...) Expand all
39 } 39 }
40 40
41 namespace sandbox { 41 namespace sandbox {
42 class TargetServices; 42 class TargetServices;
43 } 43 }
44 44
45 namespace content { 45 namespace content {
46 class GpuProcessControlImpl; 46 class GpuProcessControlImpl;
47 class GpuWatchdogThread; 47 class GpuWatchdogThread;
48 struct EstablishChannelParams; 48 struct EstablishChannelParams;
49 #if defined(OS_MACOSX)
50 struct BufferPresentedParams;
51 #endif
52 49
53 // The main thread of the GPU child process. There will only ever be one of 50 // The main thread of the GPU child process. There will only ever be one of
54 // these per process. It does process initialization and shutdown. It forwards 51 // these per process. It does process initialization and shutdown. It forwards
55 // IPC messages to gpu::GpuChannelManager, which is responsible for issuing 52 // IPC messages to gpu::GpuChannelManager, which is responsible for issuing
56 // rendering commands to the GPU. 53 // rendering commands to the GPU.
57 class GpuChildThread : public ChildThreadImpl, 54 class GpuChildThread : public ChildThreadImpl,
58 public gpu::GpuChannelManagerDelegate { 55 public gpu::GpuChannelManagerDelegate {
59 public: 56 public:
60 typedef std::queue<IPC::Message*> DeferredMessages; 57 typedef std::queue<IPC::Message*> DeferredMessages;
61 58
(...skipping 28 matching lines...) Expand all
90 87
91 // gpu::GpuChannelManagerDelegate implementation. 88 // gpu::GpuChannelManagerDelegate implementation.
92 void SetActiveURL(const GURL& url) override; 89 void SetActiveURL(const GURL& url) override;
93 void DidCreateOffscreenContext(const GURL& active_url) override; 90 void DidCreateOffscreenContext(const GURL& active_url) override;
94 void DidDestroyChannel(int client_id) override; 91 void DidDestroyChannel(int client_id) override;
95 void DidDestroyOffscreenContext(const GURL& active_url) override; 92 void DidDestroyOffscreenContext(const GURL& active_url) override;
96 void DidLoseContext(bool offscreen, 93 void DidLoseContext(bool offscreen,
97 gpu::error::ContextLostReason reason, 94 gpu::error::ContextLostReason reason,
98 const GURL& active_url) override; 95 const GURL& active_url) override;
99 void GpuMemoryUmaStats(const gpu::GPUMemoryUmaStats& params) override; 96 void GpuMemoryUmaStats(const gpu::GPUMemoryUmaStats& params) override;
100 #if defined(OS_MACOSX)
101 void SendAcceleratedSurfaceBuffersSwapped(
102 gpu::SurfaceHandle surface_handle,
103 CAContextID ca_context_id,
104 bool fullscreen_low_power_ca_context_valid,
105 CAContextID fullscreen_low_power_ca_context_id,
106 const gfx::ScopedRefCountedIOSurfaceMachPort& io_surface,
107 const gfx::Size& size,
108 float scale_factor,
109 std::vector<ui::LatencyInfo> latency_info) override;
110 #endif
111 #if defined(OS_WIN) 97 #if defined(OS_WIN)
112 void SendAcceleratedSurfaceCreatedChildWindow( 98 void SendAcceleratedSurfaceCreatedChildWindow(
113 gpu::SurfaceHandle parent_window, 99 gpu::SurfaceHandle parent_window,
114 gpu::SurfaceHandle child_window) override; 100 gpu::SurfaceHandle child_window) override;
115 #endif 101 #endif
116 void StoreShaderToDisk(int32_t client_id, 102 void StoreShaderToDisk(int32_t client_id,
117 const std::string& key, 103 const std::string& key,
118 const std::string& shader) override; 104 const std::string& shader) override;
119 105
120 // Message handlers. 106 // Message handlers.
121 void OnInitialize(const gpu::GpuPreferences& gpu_preferences); 107 void OnInitialize(const gpu::GpuPreferences& gpu_preferences);
122 void OnFinalize(); 108 void OnFinalize();
123 void OnCollectGraphicsInfo(); 109 void OnCollectGraphicsInfo();
124 void OnGetVideoMemoryUsageStats(); 110 void OnGetVideoMemoryUsageStats();
125 void OnSetVideoMemoryWindowCount(uint32_t window_count); 111 void OnSetVideoMemoryWindowCount(uint32_t window_count);
126 112
127 void OnClean(); 113 void OnClean();
128 void OnCrash(); 114 void OnCrash();
129 void OnHang(); 115 void OnHang();
130 void OnDisableWatchdog(); 116 void OnDisableWatchdog();
131 void OnGpuSwitched(); 117 void OnGpuSwitched();
132 118
133 #if defined(OS_MACOSX)
134 void OnBufferPresented(const BufferPresentedParams& params);
135 #endif
136 void OnEstablishChannel(const EstablishChannelParams& params); 119 void OnEstablishChannel(const EstablishChannelParams& params);
137 void OnCloseChannel(int32_t client_id); 120 void OnCloseChannel(int32_t client_id);
138 void OnLoadedShader(const std::string& shader); 121 void OnLoadedShader(const std::string& shader);
139 void OnDestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, 122 void OnDestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
140 int client_id, 123 int client_id,
141 const gpu::SyncToken& sync_token); 124 const gpu::SyncToken& sync_token);
142 #if defined(OS_ANDROID) 125 #if defined(OS_ANDROID)
143 void OnWakeUpGpu(); 126 void OnWakeUpGpu();
144 void OnDestroyingVideoSurface(int surface_id); 127 void OnDestroyingVideoSurface(int surface_id);
145 #endif 128 #endif
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 168
186 // Bindings to the mojom::ProcessControl impl. 169 // Bindings to the mojom::ProcessControl impl.
187 mojo::BindingSet<mojom::ProcessControl> process_control_bindings_; 170 mojo::BindingSet<mojom::ProcessControl> process_control_bindings_;
188 171
189 DISALLOW_COPY_AND_ASSIGN(GpuChildThread); 172 DISALLOW_COPY_AND_ASSIGN(GpuChildThread);
190 }; 173 };
191 174
192 } // namespace content 175 } // namespace content
193 176
194 #endif // CONTENT_GPU_GPU_CHILD_THREAD_H_ 177 #endif // CONTENT_GPU_GPU_CHILD_THREAD_H_
OLDNEW
« no previous file with comments | « content/content_common.gypi ('k') | content/gpu/gpu_child_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698