| 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 WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_ACCELERATED_SURFACE_MAC_H_ | 5 #ifndef CONTENT_CHILD_NPAPI_WEBPLUGIN_ACCELERATED_SURFACE_MAC_H_ |
| 6 #define WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_ACCELERATED_SURFACE_MAC_H_ | 6 #define CONTENT_CHILD_NPAPI_WEBPLUGIN_ACCELERATED_SURFACE_MAC_H_ |
| 7 | 7 |
| 8 #include "ui/gfx/native_widget_types.h" | 8 #include "ui/gfx/native_widget_types.h" |
| 9 #include "ui/gfx/size.h" | 9 #include "ui/gfx/size.h" |
| 10 | 10 |
| 11 // Avoid having to include OpenGL headers here. | 11 // Avoid having to include OpenGL headers here. |
| 12 typedef struct _CGLContextObject* CGLContextObj; | 12 typedef struct _CGLContextObject* CGLContextObj; |
| 13 | 13 |
| 14 namespace webkit { | 14 namespace content { |
| 15 namespace npapi { | |
| 16 | 15 |
| 17 // Interface class for interacting with an accelerated plugin surface, used | 16 // Interface class for interacting with an accelerated plugin surface, used |
| 18 // for the Core Animation flavors of plugin drawing on the Mac. | 17 // for the Core Animation flavors of plugin drawing on the Mac. |
| 19 class WebPluginAcceleratedSurface { | 18 class WebPluginAcceleratedSurface { |
| 20 public: | 19 public: |
| 21 virtual ~WebPluginAcceleratedSurface() {} | 20 virtual ~WebPluginAcceleratedSurface() {} |
| 22 | 21 |
| 23 // Sets the size of the surface. | 22 // Sets the size of the surface. |
| 24 virtual void SetSize(const gfx::Size& size) = 0; | 23 virtual void SetSize(const gfx::Size& size) = 0; |
| 25 | 24 |
| 26 // Returns the context used to draw into this surface. | 25 // Returns the context used to draw into this surface. |
| 27 // If initializing the surface failed, this will be NULL. | 26 // If initializing the surface failed, this will be NULL. |
| 28 virtual CGLContextObj context() = 0; | 27 virtual CGLContextObj context() = 0; |
| 29 | 28 |
| 30 // Readies the surface for drawing. Must be called before any drawing session. | 29 // Readies the surface for drawing. Must be called before any drawing session. |
| 31 virtual void StartDrawing() = 0; | 30 virtual void StartDrawing() = 0; |
| 32 | 31 |
| 33 // Ends a drawing session. Changes to the surface may not be reflected until | 32 // Ends a drawing session. Changes to the surface may not be reflected until |
| 34 // this is called. | 33 // this is called. |
| 35 virtual void EndDrawing() = 0; | 34 virtual void EndDrawing() = 0; |
| 36 }; | 35 }; |
| 37 | 36 |
| 38 } // namespace npapi | 37 } // namespace content |
| 39 } // namespace webkit | |
| 40 | 38 |
| 41 #endif // WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_ACCELERATED_SURFACE_MAC_H_ | 39 #endif // CONTENT_CHILD_NPAPI_WEBPLUGIN_ACCELERATED_SURFACE_MAC_H_ |
| OLD | NEW |