| 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 18 matching lines...) Expand all Loading... |
| 29 // | 29 // |
| 30 // Note: The ID can exist before the actual native handle for the surface is | 30 // Note: The ID can exist before the actual native handle for the surface is |
| 31 // created, for example to allow giving a reference to it to a renderer, so that | 31 // created, for example to allow giving a reference to it to a renderer, so that |
| 32 // it is unamibiguously identified. | 32 // it is unamibiguously identified. |
| 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_id. | 36 // Returns the native widget associated with a given surface_id. |
| 37 gfx::AcceleratedWidget AcquireNativeWidget(int surface_id) override; | 37 gfx::AcceleratedWidget AcquireNativeWidget(int surface_id) override; |
| 38 | 38 |
| 39 #if defined(OS_ANDROID) |
| 40 gfx::ScopedJavaSurface AcquireJavaSurface(int surface_id) override; |
| 41 #endif |
| 42 |
| 39 // Gets the global instance of the surface tracker. | 43 // Gets the global instance of the surface tracker. |
| 40 static GpuSurfaceTracker* Get() { return GetInstance(); } | 44 static GpuSurfaceTracker* Get() { return GetInstance(); } |
| 41 | 45 |
| 42 // Adds a surface for a native widget. Returns the surface ID. | 46 // Adds a surface for a native widget. Returns the surface ID. |
| 43 int AddSurfaceForNativeWidget(gfx::AcceleratedWidget widget); | 47 int AddSurfaceForNativeWidget(gfx::AcceleratedWidget widget); |
| 44 | 48 |
| 45 // Removes a given existing surface. | 49 // Removes a given existing surface. |
| 46 void RemoveSurface(int surface_id); | 50 void RemoveSurface(int surface_id); |
| 47 | 51 |
| 48 // Gets the native handle for the given surface. | 52 // Gets the native handle for the given surface. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 67 base::Lock lock_; | 71 base::Lock lock_; |
| 68 SurfaceMap surface_map_; | 72 SurfaceMap surface_map_; |
| 69 int next_surface_id_; | 73 int next_surface_id_; |
| 70 | 74 |
| 71 DISALLOW_COPY_AND_ASSIGN(GpuSurfaceTracker); | 75 DISALLOW_COPY_AND_ASSIGN(GpuSurfaceTracker); |
| 72 }; | 76 }; |
| 73 | 77 |
| 74 } // namespace content | 78 } // namespace content |
| 75 | 79 |
| 76 #endif // CONTENT_BROWSER_GPU_GPU_SURFACE_TRACKER_H_ | 80 #endif // CONTENT_BROWSER_GPU_GPU_SURFACE_TRACKER_H_ |
| OLD | NEW |