| 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 CONTENT_BROWSER_GPU_GPU_SURFACE_TRACKER_H_ | 5 #ifndef CONTENT_BROWSER_GPU_GPU_SURFACE_TRACKER_H_ |
| 6 #define CONTENT_BROWSER_GPU_GPU_SURFACE_TRACKER_H_ | 6 #define CONTENT_BROWSER_GPU_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 CONTENT_EXPORT GpuSurfaceTracker : public gpu::GpuSurfaceLookup { | 33 class CONTENT_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 gfx::ScopedJavaSurface AcquireJavaSurface(int surface_id) override; | 42 gl::ScopedJavaSurface AcquireJavaSurface(int surface_id) override; |
| 43 #endif | 43 #endif |
| 44 | 44 |
| 45 // Gets the global instance of the surface tracker. | 45 // Gets the global instance of the surface tracker. |
| 46 static GpuSurfaceTracker* Get() { return GetInstance(); } | 46 static GpuSurfaceTracker* Get() { return GetInstance(); } |
| 47 | 47 |
| 48 // Adds a surface for a native widget. Returns the surface ID. | 48 // Adds a surface for a native widget. Returns the surface ID. |
| 49 int AddSurfaceForNativeWidget(gfx::AcceleratedWidget widget); | 49 int AddSurfaceForNativeWidget(gfx::AcceleratedWidget widget); |
| 50 | 50 |
| 51 // Removes a given existing surface. | 51 // Removes a given existing surface. |
| 52 void RemoveSurface(gpu::SurfaceHandle surface_handle); | 52 void RemoveSurface(gpu::SurfaceHandle surface_handle); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 69 base::Lock lock_; | 69 base::Lock lock_; |
| 70 SurfaceMap surface_map_; | 70 SurfaceMap surface_map_; |
| 71 int next_surface_handle_; | 71 int next_surface_handle_; |
| 72 | 72 |
| 73 DISALLOW_COPY_AND_ASSIGN(GpuSurfaceTracker); | 73 DISALLOW_COPY_AND_ASSIGN(GpuSurfaceTracker); |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 } // namespace content | 76 } // namespace content |
| 77 | 77 |
| 78 #endif // CONTENT_BROWSER_GPU_GPU_SURFACE_TRACKER_H_ | 78 #endif // CONTENT_BROWSER_GPU_GPU_SURFACE_TRACKER_H_ |
| OLD | NEW |