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 | 7 |
8 #include <OpenGL/OpenGL.h> | 8 #include <OpenGL/OpenGL.h> |
9 #include <map> | 9 #include <map> |
10 #include <vector> | 10 #include <vector> |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 TransportDIB::Handle transport_dib); | 46 TransportDIB::Handle transport_dib); |
47 | 47 |
48 // Takes an update from WebKit about a plugin's position and size and moves | 48 // Takes an update from WebKit about a plugin's position and size and moves |
49 // the plugin accordingly. | 49 // the plugin accordingly. |
50 void MovePluginContainer(const webkit_glue::WebPluginGeometry& move); | 50 void MovePluginContainer(const webkit_glue::WebPluginGeometry& move); |
51 | 51 |
52 // Draws all of the managed plugin containers into the given OpenGL | 52 // Draws all of the managed plugin containers into the given OpenGL |
53 // context, which must already be current. | 53 // context, which must already be current. |
54 void Draw(CGLContextObj context); | 54 void Draw(CGLContextObj context); |
55 | 55 |
| 56 // Causes the next Draw call on each container to trigger a texture upload. |
| 57 // Should be called any time the drawing context has changed. |
| 58 void ForceTextureReload(); |
| 59 |
56 // Called by the container to enqueue its OpenGL texture objects for | 60 // Called by the container to enqueue its OpenGL texture objects for |
57 // deletion. | 61 // deletion. |
58 void EnqueueTextureForDeletion(GLuint texture); | 62 void EnqueueTextureForDeletion(GLuint texture); |
59 | 63 |
60 private: | 64 private: |
61 uint32 current_id_; | 65 uint32 current_id_; |
62 | 66 |
63 // Maps a "fake" plugin window handle to the corresponding container. | 67 // Maps a "fake" plugin window handle to the corresponding container. |
64 AcceleratedSurfaceContainerMac* MapIDToContainer(gfx::PluginWindowHandle id); | 68 AcceleratedSurfaceContainerMac* MapIDToContainer(gfx::PluginWindowHandle id); |
65 | 69 |
66 // A map that associates plugin window handles with their containers. | 70 // A map that associates plugin window handles with their containers. |
67 typedef std::map<gfx::PluginWindowHandle, AcceleratedSurfaceContainerMac*> | 71 typedef std::map<gfx::PluginWindowHandle, AcceleratedSurfaceContainerMac*> |
68 PluginWindowToContainerMap; | 72 PluginWindowToContainerMap; |
69 PluginWindowToContainerMap plugin_window_to_container_map_; | 73 PluginWindowToContainerMap plugin_window_to_container_map_; |
70 | 74 |
71 // A list of OpenGL textures waiting to be deleted | 75 // A list of OpenGL textures waiting to be deleted |
72 std::vector<GLuint> textures_pending_deletion_; | 76 std::vector<GLuint> textures_pending_deletion_; |
73 | 77 |
74 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerManagerMac); | 78 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerManagerMac); |
75 }; | 79 }; |
76 | 80 |
77 #endif // CHROME_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MANAGER_MAC_H_ | 81 #endif // CHROME_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MANAGER_MAC_H_ |
78 | 82 |
OLD | NEW |