OLD | NEW |
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 UI_GFX_NATIVE_WIDGET_TYPES_H_ | 5 #ifndef UI_GFX_NATIVE_WIDGET_TYPES_H_ |
6 #define UI_GFX_NATIVE_WIDGET_TYPES_H_ | 6 #define UI_GFX_NATIVE_WIDGET_TYPES_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #if defined(OS_ANDROID) | 10 #if defined(OS_ANDROID) |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 EMPTY, | 271 EMPTY, |
272 NATIVE_DIRECT, | 272 NATIVE_DIRECT, |
273 NATIVE_TRANSPORT, | 273 NATIVE_TRANSPORT, |
274 TEXTURE_TRANSPORT | 274 TEXTURE_TRANSPORT |
275 }; | 275 }; |
276 | 276 |
277 struct GLSurfaceHandle { | 277 struct GLSurfaceHandle { |
278 GLSurfaceHandle() | 278 GLSurfaceHandle() |
279 : handle(kNullPluginWindow), | 279 : handle(kNullPluginWindow), |
280 transport_type(EMPTY), | 280 transport_type(EMPTY), |
281 parent_gpu_process_id(0), | |
282 parent_client_id(0) { | 281 parent_client_id(0) { |
283 } | 282 } |
284 GLSurfaceHandle(PluginWindowHandle handle_, SurfaceType transport_) | 283 GLSurfaceHandle(PluginWindowHandle handle_, SurfaceType transport_) |
285 : handle(handle_), | 284 : handle(handle_), |
286 transport_type(transport_), | 285 transport_type(transport_), |
287 parent_gpu_process_id(0), | |
288 parent_client_id(0) { | 286 parent_client_id(0) { |
289 DCHECK(!is_null() || handle == kNullPluginWindow); | 287 DCHECK(!is_null() || handle == kNullPluginWindow); |
290 DCHECK(transport_type != TEXTURE_TRANSPORT || | 288 DCHECK(transport_type != TEXTURE_TRANSPORT || |
291 handle == kNullPluginWindow); | 289 handle == kNullPluginWindow); |
292 } | 290 } |
293 bool is_null() const { return transport_type == EMPTY; } | 291 bool is_null() const { return transport_type == EMPTY; } |
294 bool is_transport() const { | 292 bool is_transport() const { |
295 return transport_type == NATIVE_TRANSPORT || | 293 return transport_type == NATIVE_TRANSPORT || |
296 transport_type == TEXTURE_TRANSPORT; | 294 transport_type == TEXTURE_TRANSPORT; |
297 } | 295 } |
298 PluginWindowHandle handle; | 296 PluginWindowHandle handle; |
299 SurfaceType transport_type; | 297 SurfaceType transport_type; |
300 int parent_gpu_process_id; | |
301 uint32 parent_client_id; | 298 uint32 parent_client_id; |
302 }; | 299 }; |
303 | 300 |
304 // AcceleratedWidget provides a surface to compositors to paint pixels. | 301 // AcceleratedWidget provides a surface to compositors to paint pixels. |
305 #if defined(OS_WIN) | 302 #if defined(OS_WIN) |
306 typedef HWND AcceleratedWidget; | 303 typedef HWND AcceleratedWidget; |
307 const AcceleratedWidget kNullAcceleratedWidget = NULL; | 304 const AcceleratedWidget kNullAcceleratedWidget = NULL; |
308 #elif defined(USE_X11) | 305 #elif defined(USE_X11) |
309 typedef unsigned long AcceleratedWidget; | 306 typedef unsigned long AcceleratedWidget; |
310 const AcceleratedWidget kNullAcceleratedWidget = 0; | 307 const AcceleratedWidget kNullAcceleratedWidget = 0; |
311 #elif defined(OS_IOS) | 308 #elif defined(OS_IOS) |
312 typedef UIView* AcceleratedWidget; | 309 typedef UIView* AcceleratedWidget; |
313 const AcceleratedWidget kNullAcceleratedWidget = 0; | 310 const AcceleratedWidget kNullAcceleratedWidget = 0; |
314 #elif defined(OS_MACOSX) | 311 #elif defined(OS_MACOSX) |
315 typedef NSView* AcceleratedWidget; | 312 typedef NSView* AcceleratedWidget; |
316 const AcceleratedWidget kNullAcceleratedWidget = 0; | 313 const AcceleratedWidget kNullAcceleratedWidget = 0; |
317 #elif defined(OS_ANDROID) | 314 #elif defined(OS_ANDROID) |
318 typedef ANativeWindow* AcceleratedWidget; | 315 typedef ANativeWindow* AcceleratedWidget; |
319 const AcceleratedWidget kNullAcceleratedWidget = 0; | 316 const AcceleratedWidget kNullAcceleratedWidget = 0; |
320 #elif defined(USE_OZONE) | 317 #elif defined(USE_OZONE) |
321 typedef intptr_t AcceleratedWidget; | 318 typedef intptr_t AcceleratedWidget; |
322 const AcceleratedWidget kNullAcceleratedWidget = 0; | 319 const AcceleratedWidget kNullAcceleratedWidget = 0; |
323 #else | 320 #else |
324 #error unknown platform | 321 #error unknown platform |
325 #endif | 322 #endif |
326 | 323 |
327 } // namespace gfx | 324 } // namespace gfx |
328 | 325 |
329 #endif // UI_GFX_NATIVE_WIDGET_TYPES_H_ | 326 #endif // UI_GFX_NATIVE_WIDGET_TYPES_H_ |
OLD | NEW |