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> |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 // Draws the plugin container associated with the given id into the given | 68 // Draws the plugin container associated with the given id into the given |
69 // OpenGL context, which must already be current. | 69 // OpenGL context, which must already be current. |
70 void Draw(CGLContextObj context, gfx::PluginWindowHandle id); | 70 void Draw(CGLContextObj context, gfx::PluginWindowHandle id); |
71 | 71 |
72 // Causes the next Draw call on each container to trigger a texture upload. | 72 // Causes the next Draw call on each container to trigger a texture upload. |
73 // Should be called any time the drawing context has changed. | 73 // Should be called any time the drawing context has changed. |
74 void ForceTextureReload(); | 74 void ForceTextureReload(); |
75 | 75 |
76 // Notifies a surface that it has been painted to. | 76 // Notifies a surface that it has been painted to. |
77 void SetSurfaceWasPaintedTo(gfx::PluginWindowHandle id); | 77 void SetSurfaceWasPaintedTo(gfx::PluginWindowHandle id, uint64 surface_id); |
78 | 78 |
79 // Returns if a given surface should be shown. | 79 // Returns if a given surface should be shown. |
80 bool SurfaceShouldBeVisible(gfx::PluginWindowHandle id) const; | 80 bool SurfaceShouldBeVisible(gfx::PluginWindowHandle id) const; |
81 private: | 81 private: |
82 uint32 current_id_; | 82 uint32 current_id_; |
83 | 83 |
84 // Maps a "fake" plugin window handle to the corresponding container. | 84 // Maps a "fake" plugin window handle to the corresponding container. |
85 AcceleratedSurfaceContainerMac* | 85 AcceleratedSurfaceContainerMac* |
86 MapIDToContainer(gfx::PluginWindowHandle id) const; | 86 MapIDToContainer(gfx::PluginWindowHandle id) const; |
87 | 87 |
(...skipping 22 matching lines...) Expand all Loading... |
110 // Both |plugin_window_to_container_map_| and the | 110 // Both |plugin_window_to_container_map_| and the |
111 // AcceleratedSurfaceContainerMac in it are not threadsafe, but accessed from | 111 // AcceleratedSurfaceContainerMac in it are not threadsafe, but accessed from |
112 // multiple threads. All these accesses are guarded by this lock. | 112 // multiple threads. All these accesses are guarded by this lock. |
113 mutable Lock lock_; | 113 mutable Lock lock_; |
114 | 114 |
115 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerManagerMac); | 115 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerManagerMac); |
116 }; | 116 }; |
117 | 117 |
118 #endif // CHROME_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MANAGER_MAC_H_ | 118 #endif // CHROME_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MANAGER_MAC_H_ |
119 | 119 |
OLD | NEW |