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 WEBKIT_GLUE_PLUGINS_PEPPER_PLUGIN_DELEGATE_H_ | 5 #ifndef WEBKIT_GLUE_PLUGINS_PEPPER_PLUGIN_DELEGATE_H_ |
6 #define WEBKIT_GLUE_PLUGINS_PEPPER_PLUGIN_DELEGATE_H_ | 6 #define WEBKIT_GLUE_PLUGINS_PEPPER_PLUGIN_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/platform_file.h" | 11 #include "base/platform_file.h" |
12 #include "base/ref_counted.h" | 12 #include "base/ref_counted.h" |
13 #include "base/shared_memory.h" | 13 #include "base/shared_memory.h" |
14 #include "base/sync_socket.h" | 14 #include "base/sync_socket.h" |
15 #include "base/task.h" | 15 #include "base/task.h" |
| 16 #include "gfx/size.h" |
16 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
17 #include "ppapi/c/pp_completion_callback.h" | 18 #include "ppapi/c/pp_completion_callback.h" |
18 #include "ppapi/c/pp_errors.h" | 19 #include "ppapi/c/pp_errors.h" |
19 #include "ppapi/c/pp_stdint.h" | 20 #include "ppapi/c/pp_stdint.h" |
20 #include "webkit/fileapi/file_system_types.h" | 21 #include "webkit/fileapi/file_system_types.h" |
21 #include "webkit/glue/plugins/pepper_dir_contents.h" | 22 #include "webkit/glue/plugins/pepper_dir_contents.h" |
22 | 23 |
23 class AudioMessageFilter; | 24 class AudioMessageFilter; |
24 class GURL; | 25 class GURL; |
25 | 26 |
26 namespace base { | 27 namespace base { |
27 class MessageLoopProxy; | 28 class MessageLoopProxy; |
28 class Time; | 29 class Time; |
29 } | 30 } |
30 | 31 |
31 namespace fileapi { | 32 namespace fileapi { |
32 class FileSystemCallbackDispatcher; | 33 class FileSystemCallbackDispatcher; |
33 } | 34 } |
34 | 35 |
35 namespace gfx { | 36 namespace gfx { |
36 class Rect; | 37 class Rect; |
37 } | 38 } |
38 | 39 |
39 namespace gpu { | 40 namespace gpu { |
40 class CommandBuffer; | 41 namespace gles2 { |
| 42 class GLES2Implementation; |
| 43 } |
41 } | 44 } |
42 | 45 |
43 namespace skia { | 46 namespace skia { |
44 class PlatformCanvas; | 47 class PlatformCanvas; |
45 } | 48 } |
46 | 49 |
47 namespace WebKit { | 50 namespace WebKit { |
48 class WebFileChooserCompletion; | 51 class WebFileChooserCompletion; |
49 struct WebFileChooserParams; | 52 struct WebFileChooserParams; |
50 } | 53 } |
(...skipping 29 matching lines...) Expand all Loading... |
80 virtual intptr_t GetSharedMemoryHandle() const = 0; | 83 virtual intptr_t GetSharedMemoryHandle() const = 0; |
81 | 84 |
82 virtual TransportDIB* GetTransportDIB() const = 0; | 85 virtual TransportDIB* GetTransportDIB() const = 0; |
83 }; | 86 }; |
84 | 87 |
85 class PlatformContext3D { | 88 class PlatformContext3D { |
86 public: | 89 public: |
87 virtual ~PlatformContext3D() {} | 90 virtual ~PlatformContext3D() {} |
88 | 91 |
89 // Initialize the context. | 92 // Initialize the context. |
90 virtual bool Init(const gfx::Rect& position, const gfx::Rect& clip) = 0; | 93 virtual bool Init() = 0; |
91 | 94 |
92 // This call will return the address of the command buffer object that is | 95 // Present the rendered frame to the compositor. |
93 // constructed in Initialize() and is valid until this context is destroyed. | 96 virtual bool SwapBuffers() = 0; |
94 virtual gpu::CommandBuffer* GetCommandBuffer() = 0; | |
95 | 97 |
96 // Sets the function to be called on repaint. | 98 // Get the last EGL error. |
97 virtual void SetNotifyRepaintTask(Task* task) = 0; | 99 virtual unsigned GetError() = 0; |
| 100 |
| 101 // Resize the backing texture used as a back buffer by OpenGL. |
| 102 virtual void ResizeBackingTexture(const gfx::Size& size) = 0; |
| 103 |
| 104 // Set an optional callback that will be invoked when the side effects of |
| 105 // a SwapBuffers call become visible to the compositor. Takes ownership |
| 106 // of the callback. |
| 107 virtual void SetSwapBuffersCallback(Callback0::Type* callback) = 0; |
| 108 |
| 109 // If the plugin instance is backed by an OpenGL, return its ID in the |
| 110 // compositors namespace. Otherwise return 0. Returns 0 by default. |
| 111 virtual unsigned GetBackingTextureId() = 0; |
| 112 |
| 113 // This call will return the address of the GLES2 implementation for this |
| 114 // context that is constructed in Initialize() and is valid until this |
| 115 // context is destroyed. |
| 116 virtual gpu::gles2::GLES2Implementation* GetGLES2Implementation() = 0; |
98 }; | 117 }; |
99 | 118 |
100 class PlatformAudio { | 119 class PlatformAudio { |
101 public: | 120 public: |
102 class Client { | 121 class Client { |
103 protected: | 122 protected: |
104 virtual ~Client() {} | 123 virtual ~Client() {} |
105 | 124 |
106 public: | 125 public: |
107 // Called when the stream is created. | 126 // Called when the stream is created. |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 virtual void DidStartLoading() = 0; | 271 virtual void DidStartLoading() = 0; |
253 virtual void DidStopLoading() = 0; | 272 virtual void DidStopLoading() = 0; |
254 | 273 |
255 // Sets restrictions on how the content can be used (i.e. no print/copy). | 274 // Sets restrictions on how the content can be used (i.e. no print/copy). |
256 virtual void SetContentRestriction(int restrictions) = 0; | 275 virtual void SetContentRestriction(int restrictions) = 0; |
257 }; | 276 }; |
258 | 277 |
259 } // namespace pepper | 278 } // namespace pepper |
260 | 279 |
261 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_PLUGIN_DELEGATE_H_ | 280 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_PLUGIN_DELEGATE_H_ |
OLD | NEW |