| 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 GPU_IPC_COMMON_GPU_SURFACE_TRACKER_H_ | 5 #ifndef GPU_IPC_COMMON_GPU_SURFACE_TRACKER_H_ |
| 6 #define GPU_IPC_COMMON_GPU_SURFACE_TRACKER_H_ | 6 #define GPU_IPC_COMMON_GPU_SURFACE_TRACKER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 // This class is thread safe. | 32 // This class is thread safe. |
| 33 class GPU_EXPORT GpuSurfaceTracker : public gpu::GpuSurfaceLookup { | 33 class GPU_EXPORT GpuSurfaceTracker : public gpu::GpuSurfaceLookup { |
| 34 public: | 34 public: |
| 35 // GpuSurfaceLookup implementation: | 35 // GpuSurfaceLookup implementation: |
| 36 // Returns the native widget associated with a given surface_handle. | 36 // Returns the native widget associated with a given surface_handle. |
| 37 // On Android, this adds a reference on the ANativeWindow. | 37 // On Android, this adds a reference on the ANativeWindow. |
| 38 gfx::AcceleratedWidget AcquireNativeWidget( | 38 gfx::AcceleratedWidget AcquireNativeWidget( |
| 39 gpu::SurfaceHandle surface_handle) override; | 39 gpu::SurfaceHandle surface_handle) override; |
| 40 | 40 |
| 41 #if defined(OS_ANDROID) | 41 #if defined(OS_ANDROID) |
| 42 void RegisterViewSurface(int surface_id, | 42 void RegisterViewSurface(int surface_id, jobject j_surface); |
| 43 const base::android::JavaRef<jobject>& j_surface); | |
| 44 void UnregisterViewSurface(int surface_id); | 43 void UnregisterViewSurface(int surface_id); |
| 45 gl::ScopedJavaSurface AcquireJavaSurface(int surface_id) override; | 44 gl::ScopedJavaSurface AcquireJavaSurface(int surface_id) override; |
| 46 #endif | 45 #endif |
| 47 | 46 |
| 48 // Gets the global instance of the surface tracker. | 47 // Gets the global instance of the surface tracker. |
| 49 static GpuSurfaceTracker* Get() { return GetInstance(); } | 48 static GpuSurfaceTracker* Get() { return GetInstance(); } |
| 50 | 49 |
| 51 // Adds a surface for a native widget. Returns the surface ID. | 50 // Adds a surface for a native widget. Returns the surface ID. |
| 52 int AddSurfaceForNativeWidget(gfx::AcceleratedWidget widget); | 51 int AddSurfaceForNativeWidget(gfx::AcceleratedWidget widget); |
| 53 | 52 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 82 SurfaceViewMap surface_view_map_; | 81 SurfaceViewMap surface_view_map_; |
| 83 #endif | 82 #endif |
| 84 | 83 |
| 85 DISALLOW_COPY_AND_ASSIGN(GpuSurfaceTracker); | 84 DISALLOW_COPY_AND_ASSIGN(GpuSurfaceTracker); |
| 86 }; | 85 }; |
| 87 | 86 |
| 88 } // namespace ui | 87 } // namespace ui |
| 89 | 88 |
| 90 #endif // GPU_IPC_COMMON_GPU_SURFACE_TRACKER_H_ | 89 #endif // GPU_IPC_COMMON_GPU_SURFACE_TRACKER_H_ |
| 91 | 90 |
| OLD | NEW |