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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 // Draws the plugin container associated with the given id into the given | 58 // Draws the plugin container associated with the given id into the given |
59 // OpenGL context, which must already be current. | 59 // OpenGL context, which must already be current. |
60 void Draw(CGLContextObj context, | 60 void Draw(CGLContextObj context, |
61 gfx::PluginWindowHandle id, | 61 gfx::PluginWindowHandle id, |
62 bool draw_root_container); | 62 bool draw_root_container); |
63 | 63 |
64 // Causes the next Draw call on each container to trigger a texture upload. | 64 // Causes the next Draw call on each container to trigger a texture upload. |
65 // Should be called any time the drawing context has changed. | 65 // Should be called any time the drawing context has changed. |
66 void ForceTextureReload(); | 66 void ForceTextureReload(); |
67 | 67 |
| 68 // Notifies a surface that it has been painted to. |
| 69 void SetSurfaceWasPaintedTo(gfx::PluginWindowHandle id); |
| 70 |
| 71 // Returns if a given surface should be shown. |
| 72 bool SurfaceShouldBeVisible(gfx::PluginWindowHandle id) const; |
68 private: | 73 private: |
69 uint32 current_id_; | 74 uint32 current_id_; |
70 | 75 |
71 // Maps a "fake" plugin window handle to the corresponding container. | 76 // Maps a "fake" plugin window handle to the corresponding container. |
72 AcceleratedSurfaceContainerMac* MapIDToContainer(gfx::PluginWindowHandle id); | 77 AcceleratedSurfaceContainerMac* |
| 78 MapIDToContainer(gfx::PluginWindowHandle id) const; |
73 | 79 |
74 // A map that associates plugin window handles with their containers. | 80 // A map that associates plugin window handles with their containers. |
75 typedef std::map<gfx::PluginWindowHandle, AcceleratedSurfaceContainerMac*> | 81 typedef std::map<gfx::PluginWindowHandle, AcceleratedSurfaceContainerMac*> |
76 PluginWindowToContainerMap; | 82 PluginWindowToContainerMap; |
77 PluginWindowToContainerMap plugin_window_to_container_map_; | 83 PluginWindowToContainerMap plugin_window_to_container_map_; |
78 | 84 |
79 // The "root" container, which is only used to draw the output of | 85 // The "root" container, which is only used to draw the output of |
80 // the accelerated compositor if it is active. Currently, | 86 // the accelerated compositor if it is active. Currently, |
81 // accelerated plugins (Core Animation and Pepper 3D) are drawn on | 87 // accelerated plugins (Core Animation and Pepper 3D) are drawn on |
82 // top of the page's contents rather than transformed and composited | 88 // top of the page's contents rather than transformed and composited |
83 // with the rest of the page. At some point we would like them to be | 89 // with the rest of the page. At some point we would like them to be |
84 // treated uniformly with other page elements; when this is done, | 90 // treated uniformly with other page elements; when this is done, |
85 // the separate treatment of the root container can go away because | 91 // the separate treatment of the root container can go away because |
86 // there will only be one container active when the accelerated | 92 // there will only be one container active when the accelerated |
87 // compositor is active. | 93 // compositor is active. |
88 AcceleratedSurfaceContainerMac* root_container_; | 94 AcceleratedSurfaceContainerMac* root_container_; |
89 | 95 |
90 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerManagerMac); | 96 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerManagerMac); |
91 }; | 97 }; |
92 | 98 |
93 #endif // CHROME_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MANAGER_MAC_H_ | 99 #endif // CHROME_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MANAGER_MAC_H_ |
94 | 100 |
OLD | NEW |