| 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" |
| 11 #include "base/memory/singleton.h" | 11 #include "base/memory/singleton.h" |
| 12 #include "base/synchronization/lock.h" | 12 #include "base/synchronization/lock.h" |
| 13 #include "content/common/gpu/gpu_surface_lookup.h" | 13 #include "content/common/gpu/gpu_surface_lookup.h" |
| 14 #include "ui/gfx/native_widget_types.h" | 14 #include "ui/gfx/native_widget_types.h" |
| 15 #include "ui/gfx/size.h" | 15 #include "ui/gfx/size.h" |
| 16 | 16 |
| 17 namespace content { |
| 18 |
| 17 // This class is responsible for managing rendering surfaces exposed to the | 19 // This class is responsible for managing rendering surfaces exposed to the |
| 18 // GPU process. Every surface gets registered to this class, and gets an ID. | 20 // GPU process. Every surface gets registered to this class, and gets an ID. |
| 19 // All calls to and from the GPU process, with the exception of | 21 // All calls to and from the GPU process, with the exception of |
| 20 // CreateViewCommandBuffer, refer to the rendering surface by its ID. | 22 // CreateViewCommandBuffer, refer to the rendering surface by its ID. |
| 21 // This class is thread safe. | 23 // This class is thread safe. |
| 22 // | 24 // |
| 23 // Note: The ID can exist before the actual native handle for the surface is | 25 // Note: The ID can exist before the actual native handle for the surface is |
| 24 // created, for example to allow giving a reference to it to a renderer, so that | 26 // created, for example to allow giving a reference to it to a renderer, so that |
| 25 // it is unamibiguously identified. | 27 // it is unamibiguously identified. |
| 26 class GpuSurfaceTracker : public GpuSurfaceLookup { | 28 class GpuSurfaceTracker : public GpuSurfaceLookup { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 GpuSurfaceTracker(); | 87 GpuSurfaceTracker(); |
| 86 virtual ~GpuSurfaceTracker(); | 88 virtual ~GpuSurfaceTracker(); |
| 87 | 89 |
| 88 base::Lock lock_; | 90 base::Lock lock_; |
| 89 SurfaceMap surface_map_; | 91 SurfaceMap surface_map_; |
| 90 int next_surface_id_; | 92 int next_surface_id_; |
| 91 | 93 |
| 92 DISALLOW_COPY_AND_ASSIGN(GpuSurfaceTracker); | 94 DISALLOW_COPY_AND_ASSIGN(GpuSurfaceTracker); |
| 93 }; | 95 }; |
| 94 | 96 |
| 97 } // namespace content |
| 98 |
| 95 #endif // CONTENT_BROWSER_GPU_GPU_SURFACE_TRACKER_H_ | 99 #endif // CONTENT_BROWSER_GPU_GPU_SURFACE_TRACKER_H_ |
| OLD | NEW |