OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_RENDERER_HOST_ACCELERATED_SURFACE_CONTAINER_MANAGER_MAC_
H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_SURFACE_CONTAINER_MANAGER_MAC_
H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_SURFACE_CONTAINER_MANAGER_MAC_
H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_SURFACE_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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 75 |
76 // Draws the plugin container associated with the given id into the given | 76 // Draws the plugin container associated with the given id into the given |
77 // OpenGL context, which must already be current. | 77 // OpenGL context, which must already be current. |
78 void Draw(CGLContextObj context, gfx::PluginWindowHandle id); | 78 void Draw(CGLContextObj context, gfx::PluginWindowHandle id); |
79 | 79 |
80 // Causes the next Draw call on each container to trigger a texture upload. | 80 // Causes the next Draw call on each container to trigger a texture upload. |
81 // Should be called any time the drawing context has changed. | 81 // Should be called any time the drawing context has changed. |
82 void ForceTextureReload(); | 82 void ForceTextureReload(); |
83 | 83 |
84 // Notifies a surface that it has been painted to. | 84 // Notifies a surface that it has been painted to. |
85 void SetSurfaceWasPaintedTo(gfx::PluginWindowHandle id, uint64 surface_id); | |
86 void SetSurfaceWasPaintedTo(gfx::PluginWindowHandle id, | 85 void SetSurfaceWasPaintedTo(gfx::PluginWindowHandle id, |
87 uint64 surface_id, | 86 uint64 surface_handle); |
| 87 void SetSurfaceWasPaintedTo(gfx::PluginWindowHandle id, |
| 88 uint64 surface_handle, |
88 const gfx::Rect& update_rect); | 89 const gfx::Rect& update_rect); |
89 | 90 |
90 // Notifies the root container that its surface is invalid. | 91 // Notifies the root container that its surface is invalid. |
91 void SetRootSurfaceInvalid(); | 92 void SetRootSurfaceInvalid(); |
92 | 93 |
93 // Returns if a given surface should be shown. | 94 // Returns if a given surface should be shown. |
94 bool SurfaceShouldBeVisible(gfx::PluginWindowHandle id) const; | 95 bool SurfaceShouldBeVisible(gfx::PluginWindowHandle id) const; |
95 private: | 96 private: |
96 uint32 current_id_; | 97 uint32 current_id_; |
97 | 98 |
(...skipping 25 matching lines...) Expand all Loading... |
123 | 124 |
124 // Both |plugin_window_to_container_map_| and the | 125 // Both |plugin_window_to_container_map_| and the |
125 // AcceleratedSurfaceContainerMac in it are not threadsafe, but accessed from | 126 // AcceleratedSurfaceContainerMac in it are not threadsafe, but accessed from |
126 // multiple threads. All these accesses are guarded by this lock. | 127 // multiple threads. All these accesses are guarded by this lock. |
127 mutable base::Lock lock_; | 128 mutable base::Lock lock_; |
128 | 129 |
129 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerManagerMac); | 130 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerManagerMac); |
130 }; | 131 }; |
131 | 132 |
132 #endif // CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_SURFACE_CONTAINER_MANAGER_M
AC_H_ | 133 #endif // CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_SURFACE_CONTAINER_MANAGER_M
AC_H_ |
OLD | NEW |