| OLD | NEW |
| 1 // Copyright (c) 2010 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_GPU_PLUGIN_CONTAINER_MAC_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_SURFACE_CONTAINER_MAC_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MAC_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_SURFACE_CONTAINER_MAC_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 // The "GPU plugin" is currently implemented as a special kind of | 9 // The "GPU plugin" is currently implemented as a special kind of |
| 10 // NPAPI plugin to provide high-performance on-screen 3D rendering for | 10 // NPAPI plugin to provide high-performance on-screen 3D rendering for |
| 11 // Pepper 3D. | 11 // Pepper 3D. |
| 12 // | 12 // |
| 13 // On Windows and X11 platforms the GPU plugin relies on cross-process | 13 // On Windows and X11 platforms the GPU plugin relies on cross-process |
| 14 // parenting of windows, which is not supported via any public APIs in | 14 // parenting of windows, which is not supported via any public APIs in |
| 15 // the Mac OS X window system. | 15 // the Mac OS X window system. |
| 16 // | 16 // |
| 17 // To achieve full hardware acceleration we use the new IOSurface APIs | 17 // To achieve full hardware acceleration we use the new IOSurface APIs |
| 18 // introduced in Mac OS X 10.6. The GPU plugin's process produces an | 18 // introduced in Mac OS X 10.6. The GPU plugin's process produces an |
| 19 // IOSurface and renders into it using OpenGL. It uses the | 19 // IOSurface and renders into it using OpenGL. It uses the |
| 20 // IOSurfaceGetID and IOSurfaceLookup APIs to pass a reference to this | 20 // IOSurfaceGetID and IOSurfaceLookup APIs to pass a reference to this |
| 21 // surface to the browser process for on-screen rendering. The GPU | 21 // surface to the browser process for on-screen rendering. The GPU |
| 22 // plugin essentially looks like a windowless plugin; the browser | 22 // plugin essentially looks like a windowless plugin; the browser |
| 23 // process gets all of the mouse events, because the plugin process | 23 // process gets all of the mouse events, because the plugin process |
| 24 // does not have an on-screen window. | 24 // does not have an on-screen window. |
| 25 // | 25 // |
| 26 // This class encapsulates some of the management of these data | 26 // This class encapsulates some of the management of these data |
| 27 // structures, in conjunction with the AcceleratedSurfaceContainerManagerMac. | 27 // structures, in conjunction with the AcceleratedSurfaceContainerManagerMac. |
| 28 | 28 |
| 29 #include <CoreFoundation/CoreFoundation.h> | 29 #include <CoreFoundation/CoreFoundation.h> |
| 30 #include <OpenGL/OpenGL.h> | 30 #include <OpenGL/OpenGL.h> |
| 31 | 31 |
| 32 #include "app/surface/transport_dib.h" | |
| 33 #include "base/basictypes.h" | 32 #include "base/basictypes.h" |
| 34 #include "base/mac/scoped_cftyperef.h" | 33 #include "base/mac/scoped_cftyperef.h" |
| 35 #include "base/scoped_ptr.h" | 34 #include "base/scoped_ptr.h" |
| 36 #include "ui/gfx/native_widget_types.h" | 35 #include "ui/gfx/native_widget_types.h" |
| 37 #include "ui/gfx/rect.h" | 36 #include "ui/gfx/rect.h" |
| 37 #include "ui/gfx/surface/transport_dib.h" |
| 38 | 38 |
| 39 namespace webkit { | 39 namespace webkit { |
| 40 namespace npapi { | 40 namespace npapi { |
| 41 struct WebPluginGeometry; | 41 struct WebPluginGeometry; |
| 42 } | 42 } |
| 43 } | 43 } |
| 44 | 44 |
| 45 class AcceleratedSurfaceContainerManagerMac; | 45 class AcceleratedSurfaceContainerManagerMac; |
| 46 | 46 |
| 47 class AcceleratedSurfaceContainerMac { | 47 class AcceleratedSurfaceContainerMac { |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 142 |
| 143 // Releases the IOSurface reference, if any, retained by this object. | 143 // Releases the IOSurface reference, if any, retained by this object. |
| 144 void ReleaseIOSurface(); | 144 void ReleaseIOSurface(); |
| 145 | 145 |
| 146 // Enqueue our texture for later deletion. | 146 // Enqueue our texture for later deletion. |
| 147 void EnqueueTextureForDeletion(); | 147 void EnqueueTextureForDeletion(); |
| 148 | 148 |
| 149 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerMac); | 149 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerMac); |
| 150 }; | 150 }; |
| 151 | 151 |
| 152 #endif // CONTENT_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MAC_H_ | 152 #endif // CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_SURFACE_CONTAINER_MAC_H_ |
| OLD | NEW |