| 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 <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 SurfaceRef() { } | 44 SurfaceRef() { } |
| 45 virtual ~SurfaceRef() { } | 45 virtual ~SurfaceRef() { } |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 friend class base::RefCountedThreadSafe<SurfaceRef>; | 48 friend class base::RefCountedThreadSafe<SurfaceRef>; |
| 49 DISALLOW_COPY_AND_ASSIGN(SurfaceRef); | 49 DISALLOW_COPY_AND_ASSIGN(SurfaceRef); |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 // GpuSurfaceLookup implementation: | 52 // GpuSurfaceLookup implementation: |
| 53 // Returns the native widget associated with a given surface_id. | 53 // Returns the native widget associated with a given surface_id. |
| 54 virtual gfx::AcceleratedWidget AcquireNativeWidget(int surface_id) OVERRIDE; | 54 virtual gfx::AcceleratedWidget AcquireNativeWidget(int surface_id) override; |
| 55 | 55 |
| 56 // Gets the global instance of the surface tracker. | 56 // Gets the global instance of the surface tracker. |
| 57 static GpuSurfaceTracker* Get() { return GetInstance(); } | 57 static GpuSurfaceTracker* Get() { return GetInstance(); } |
| 58 | 58 |
| 59 // Adds a surface for a given RenderWidgetHost. |renderer_id| is the renderer | 59 // Adds a surface for a given RenderWidgetHost. |renderer_id| is the renderer |
| 60 // process ID, |render_widget_id| is the RenderWidgetHost route id within that | 60 // process ID, |render_widget_id| is the RenderWidgetHost route id within that |
| 61 // renderer. Returns the surface ID. | 61 // renderer. Returns the surface ID. |
| 62 int AddSurfaceForRenderer(int renderer_id, int render_widget_id); | 62 int AddSurfaceForRenderer(int renderer_id, int render_widget_id); |
| 63 | 63 |
| 64 // Looks up a surface for a given RenderWidgetHost. Returns the surface | 64 // Looks up a surface for a given RenderWidgetHost. Returns the surface |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 base::Lock lock_; | 129 base::Lock lock_; |
| 130 SurfaceMap surface_map_; | 130 SurfaceMap surface_map_; |
| 131 int next_surface_id_; | 131 int next_surface_id_; |
| 132 | 132 |
| 133 DISALLOW_COPY_AND_ASSIGN(GpuSurfaceTracker); | 133 DISALLOW_COPY_AND_ASSIGN(GpuSurfaceTracker); |
| 134 }; | 134 }; |
| 135 | 135 |
| 136 } // namespace content | 136 } // namespace content |
| 137 | 137 |
| 138 #endif // CONTENT_BROWSER_GPU_GPU_SURFACE_TRACKER_H_ | 138 #endif // CONTENT_BROWSER_GPU_GPU_SURFACE_TRACKER_H_ |
| OLD | NEW |