| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 // Draws the plugin container associated with the given id into the given | 72 // Draws the plugin container associated with the given id into the given |
| 73 // OpenGL context, which must already be current. | 73 // OpenGL context, which must already be current. |
| 74 void Draw(CGLContextObj context, gfx::PluginWindowHandle id); | 74 void Draw(CGLContextObj context, gfx::PluginWindowHandle id); |
| 75 | 75 |
| 76 // Causes the next Draw call on each container to trigger a texture upload. | 76 // Causes the next Draw call on each container to trigger a texture upload. |
| 77 // Should be called any time the drawing context has changed. | 77 // Should be called any time the drawing context has changed. |
| 78 void ForceTextureReload(); | 78 void ForceTextureReload(); |
| 79 | 79 |
| 80 // Notifies a surface that it has been painted to. | 80 // Notifies a surface that it has been painted to. |
| 81 void SetSurfaceWasPaintedTo(gfx::PluginWindowHandle id, uint64 surface_id); | 81 void SetSurfaceWasPaintedTo(gfx::PluginWindowHandle id, uint64 surface_id); |
| 82 void SetSurfaceWasPaintedTo(gfx::PluginWindowHandle id, |
| 83 uint64 surface_id, |
| 84 int x, int y, |
| 85 int width, int height); |
| 82 | 86 |
| 83 // Notifies the root container that its surface is invalid. | 87 // Notifies the root container that its surface is invalid. |
| 84 void SetRootSurfaceInvalid(); | 88 void SetRootSurfaceInvalid(); |
| 85 | 89 |
| 86 // Returns if a given surface should be shown. | 90 // Returns if a given surface should be shown. |
| 87 bool SurfaceShouldBeVisible(gfx::PluginWindowHandle id) const; | 91 bool SurfaceShouldBeVisible(gfx::PluginWindowHandle id) const; |
| 88 private: | 92 private: |
| 89 uint32 current_id_; | 93 uint32 current_id_; |
| 90 | 94 |
| 91 // Maps a "fake" plugin window handle to the corresponding container. | 95 // Maps a "fake" plugin window handle to the corresponding container. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 116 | 120 |
| 117 // Both |plugin_window_to_container_map_| and the | 121 // Both |plugin_window_to_container_map_| and the |
| 118 // AcceleratedSurfaceContainerMac in it are not threadsafe, but accessed from | 122 // AcceleratedSurfaceContainerMac in it are not threadsafe, but accessed from |
| 119 // multiple threads. All these accesses are guarded by this lock. | 123 // multiple threads. All these accesses are guarded by this lock. |
| 120 mutable base::Lock lock_; | 124 mutable base::Lock lock_; |
| 121 | 125 |
| 122 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerManagerMac); | 126 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerManagerMac); |
| 123 }; | 127 }; |
| 124 | 128 |
| 125 #endif // CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_SURFACE_CONTAINER_MANAGER_M
AC_H_ | 129 #endif // CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_SURFACE_CONTAINER_MANAGER_M
AC_H_ |
| OLD | NEW |