Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 GPU_IPC_COMMON_SURFACE_HANDLE_H_ | 5 #ifndef GPU_IPC_COMMON_SURFACE_HANDLE_H_ |
| 6 #define GPU_IPC_COMMON_SURFACE_HANDLE_H_ | 6 #define GPU_IPC_COMMON_SURFACE_HANDLE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 22 | 22 |
| 23 // On Windows, Linux and Chrome OS, we can use a AcceleratedWidget across | 23 // On Windows, Linux and Chrome OS, we can use a AcceleratedWidget across |
| 24 // processes, so SurfaceHandle is exactly that. | 24 // processes, so SurfaceHandle is exactly that. |
| 25 // On Mac and Android, there is no type we can directly access across processes, | 25 // On Mac and Android, there is no type we can directly access across processes, |
| 26 // so we go through the GpuSurfaceTracker, and SurfaceHandle is a (scalar) | 26 // so we go through the GpuSurfaceTracker, and SurfaceHandle is a (scalar) |
| 27 // handle generated by that. | 27 // handle generated by that. |
| 28 // On NaCl, we don't have native surfaces per se, but we need SurfaceHandle to | 28 // On NaCl, we don't have native surfaces per se, but we need SurfaceHandle to |
| 29 // be defined, because some APIs that use it are referenced there. | 29 // be defined, because some APIs that use it are referenced there. |
| 30 #if defined(GPU_SURFACE_HANDLE_IS_ACCELERATED_WINDOW) | 30 #if defined(GPU_SURFACE_HANDLE_IS_ACCELERATED_WINDOW) |
| 31 using SurfaceHandle = gfx::AcceleratedWidget; | 31 using SurfaceHandle = gfx::AcceleratedWidget; |
| 32 const SurfaceHandle kNullSurfaceHandle = gfx::kNullAcceleratedWidget; | 32 constexpr SurfaceHandle kNullSurfaceHandle = gfx::kNullAcceleratedWidget; |
|
ccameron
2016/09/29 20:47:53
This is not strictly necessary, but it'll be neede
| |
| 33 #elif defined(OS_MACOSX) || defined(OS_ANDROID) || defined(OS_NACL) | 33 #elif defined(OS_MACOSX) || defined(OS_ANDROID) || defined(OS_NACL) |
| 34 using SurfaceHandle = int32_t; | 34 using SurfaceHandle = int32_t; |
| 35 const SurfaceHandle kNullSurfaceHandle = 0; | 35 constexpr SurfaceHandle kNullSurfaceHandle = 0; |
| 36 #else | 36 #else |
| 37 #error Platform not supported. | 37 #error Platform not supported. |
| 38 #endif | 38 #endif |
| 39 | 39 |
| 40 } // namespace gpu | 40 } // namespace gpu |
| 41 | 41 |
| 42 #endif // GPU_IPC_COMMON_SURFACE_HANDLE_H_ | 42 #endif // GPU_IPC_COMMON_SURFACE_HANDLE_H_ |
| OLD | NEW |