OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MANAGER_MAC_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MANAGER_MAC_H_ |
6 #define CHROME_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MANAGER_MAC_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MANAGER_MAC_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <OpenGL/OpenGL.h> | 9 #include <OpenGL/OpenGL.h> |
10 #include <map> | 10 #include <map> |
11 | 11 |
12 #include "app/surface/transport_dib.h" | 12 #include "app/surface/transport_dib.h" |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/synchronization/lock.h" | 14 #include "base/synchronization/lock.h" |
15 #include "ui/gfx/native_widget_types.h" | 15 #include "ui/gfx/native_widget_types.h" |
16 | 16 |
17 namespace webkit { | 17 namespace webkit { |
18 namespace npapi { | 18 namespace npapi { |
19 struct WebPluginGeometry; | 19 struct WebPluginGeometry; |
20 } | 20 } |
21 } | 21 } |
22 | 22 |
23 class AcceleratedSurfaceContainerMac; | 23 class AcceleratedSurfaceContainerMac; |
24 | 24 |
25 // Helper class that manages the backing store and on-screen rendering | 25 // Helper class that manages the backing store and on-screen rendering |
26 // of instances of the GPU plugin on the Mac. | 26 // of instances of the GPU plugin on the Mac. |
27 class AcceleratedSurfaceContainerManagerMac { | 27 class AcceleratedSurfaceContainerManagerMac { |
28 public: | 28 public: |
29 AcceleratedSurfaceContainerManagerMac(); | 29 AcceleratedSurfaceContainerManagerMac(); |
| 30 ~AcceleratedSurfaceContainerManagerMac(); |
30 | 31 |
31 // Allocates a new "fake" PluginWindowHandle, which is used as the | 32 // Allocates a new "fake" PluginWindowHandle, which is used as the |
32 // key for the other operations. | 33 // key for the other operations. |
33 gfx::PluginWindowHandle AllocateFakePluginWindowHandle(bool opaque, | 34 gfx::PluginWindowHandle AllocateFakePluginWindowHandle(bool opaque, |
34 bool root); | 35 bool root); |
35 | 36 |
36 // Destroys a fake PluginWindowHandle and associated storage. | 37 // Destroys a fake PluginWindowHandle and associated storage. |
37 void DestroyFakePluginWindowHandle(gfx::PluginWindowHandle id); | 38 void DestroyFakePluginWindowHandle(gfx::PluginWindowHandle id); |
38 | 39 |
39 // Indicates whether the given PluginWindowHandle is "root", which | 40 // Indicates whether the given PluginWindowHandle is "root", which |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 // Both |plugin_window_to_container_map_| and the | 117 // Both |plugin_window_to_container_map_| and the |
117 // AcceleratedSurfaceContainerMac in it are not threadsafe, but accessed from | 118 // AcceleratedSurfaceContainerMac in it are not threadsafe, but accessed from |
118 // multiple threads. All these accesses are guarded by this lock. | 119 // multiple threads. All these accesses are guarded by this lock. |
119 mutable base::Lock lock_; | 120 mutable base::Lock lock_; |
120 | 121 |
121 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerManagerMac); | 122 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerManagerMac); |
122 }; | 123 }; |
123 | 124 |
124 #endif // CHROME_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MANAGER_MAC_H_ | 125 #endif // CHROME_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MANAGER_MAC_H_ |
125 | 126 |
OLD | NEW |