| 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> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/synchronization/lock.h" | 13 #include "base/synchronization/lock.h" |
| 14 #include "ui/gfx/native_widget_types.h" | 14 #include "ui/gfx/native_widget_types.h" |
| 15 #include "ui/gfx/surface/transport_dib.h" | 15 #include "ui/gfx/surface/transport_dib.h" |
| 16 | 16 |
| 17 namespace gfx { |
| 18 class Rect; |
| 19 } |
| 20 |
| 17 namespace webkit { | 21 namespace webkit { |
| 18 namespace npapi { | 22 namespace npapi { |
| 19 struct WebPluginGeometry; | 23 struct WebPluginGeometry; |
| 20 } | 24 } |
| 21 } | 25 } |
| 22 | 26 |
| 23 class AcceleratedSurfaceContainerMac; | 27 class AcceleratedSurfaceContainerMac; |
| 24 | 28 |
| 25 // Helper class that manages the backing store and on-screen rendering | 29 // Helper class that manages the backing store and on-screen rendering |
| 26 // of instances of the GPU plugin on the Mac. | 30 // of instances of the GPU plugin on the Mac. |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 // 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 |
| 73 // OpenGL context, which must already be current. | 77 // OpenGL context, which must already be current. |
| 74 void Draw(CGLContextObj context, gfx::PluginWindowHandle id); | 78 void Draw(CGLContextObj context, gfx::PluginWindowHandle id); |
| 75 | 79 |
| 76 // 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. |
| 77 // Should be called any time the drawing context has changed. | 81 // Should be called any time the drawing context has changed. |
| 78 void ForceTextureReload(); | 82 void ForceTextureReload(); |
| 79 | 83 |
| 80 // Notifies a surface that it has been painted to. | 84 // Notifies a surface that it has been painted to. |
| 81 void SetSurfaceWasPaintedTo(gfx::PluginWindowHandle id, uint64 surface_id); | 85 void SetSurfaceWasPaintedTo(gfx::PluginWindowHandle id, uint64 surface_id); |
| 86 void SetSurfaceWasPaintedTo(gfx::PluginWindowHandle id, |
| 87 uint64 surface_id, |
| 88 const gfx::Rect& update_rect); |
| 82 | 89 |
| 83 // Notifies the root container that its surface is invalid. | 90 // Notifies the root container that its surface is invalid. |
| 84 void SetRootSurfaceInvalid(); | 91 void SetRootSurfaceInvalid(); |
| 85 | 92 |
| 86 // Returns if a given surface should be shown. | 93 // Returns if a given surface should be shown. |
| 87 bool SurfaceShouldBeVisible(gfx::PluginWindowHandle id) const; | 94 bool SurfaceShouldBeVisible(gfx::PluginWindowHandle id) const; |
| 88 private: | 95 private: |
| 89 uint32 current_id_; | 96 uint32 current_id_; |
| 90 | 97 |
| 91 // Maps a "fake" plugin window handle to the corresponding container. | 98 // Maps a "fake" plugin window handle to the corresponding container. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 116 | 123 |
| 117 // Both |plugin_window_to_container_map_| and the | 124 // Both |plugin_window_to_container_map_| and the |
| 118 // AcceleratedSurfaceContainerMac in it are not threadsafe, but accessed from | 125 // AcceleratedSurfaceContainerMac in it are not threadsafe, but accessed from |
| 119 // multiple threads. All these accesses are guarded by this lock. | 126 // multiple threads. All these accesses are guarded by this lock. |
| 120 mutable base::Lock lock_; | 127 mutable base::Lock lock_; |
| 121 | 128 |
| 122 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerManagerMac); | 129 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerManagerMac); |
| 123 }; | 130 }; |
| 124 | 131 |
| 125 #endif // CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_SURFACE_CONTAINER_MANAGER_M
AC_H_ | 132 #endif // CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_SURFACE_CONTAINER_MANAGER_M
AC_H_ |
| OLD | NEW |