| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ |
| 6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ | 6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 | 200 |
| 201 // Commit the texture mailbox to the screen. | 201 // Commit the texture mailbox to the screen. |
| 202 void CommitTextureMailbox(const cc::TextureMailbox& texture_mailbox); | 202 void CommitTextureMailbox(const cc::TextureMailbox& texture_mailbox); |
| 203 | 203 |
| 204 // Passes the committed texture to |texture_layer_| and marks it as in use. | 204 // Passes the committed texture to |texture_layer_| and marks it as in use. |
| 205 void PassCommittedTextureToTextureLayer(); | 205 void PassCommittedTextureToTextureLayer(); |
| 206 | 206 |
| 207 // Callback when the compositor is finished consuming the committed texture. | 207 // Callback when the compositor is finished consuming the committed texture. |
| 208 void FinishedConsumingCommittedTexture( | 208 void FinishedConsumingCommittedTexture( |
| 209 const cc::TextureMailbox& texture_mailbox, | 209 const cc::TextureMailbox& texture_mailbox, |
| 210 scoped_refptr<PPB_Graphics3D_Impl> graphics_3d, |
| 210 const gpu::SyncToken& sync_token, | 211 const gpu::SyncToken& sync_token, |
| 211 bool is_lost); | 212 bool is_lost); |
| 212 | 213 |
| 213 // Called when the out-of-process plugin implementing this instance crashed. | 214 // Called when the out-of-process plugin implementing this instance crashed. |
| 214 void InstanceCrashed(); | 215 void InstanceCrashed(); |
| 215 | 216 |
| 216 // PPB_Instance and PPB_Instance_Private implementation. | 217 // PPB_Instance and PPB_Instance_Private implementation. |
| 217 bool full_frame() const { return full_frame_; } | 218 bool full_frame() const { return full_frame_; } |
| 218 const ppapi::ViewData& view_data() const { return view_data_; } | 219 const ppapi::ViewData& view_data() const { return view_data_; } |
| 219 | 220 |
| (...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 961 | 962 |
| 962 bool is_deleted_; | 963 bool is_deleted_; |
| 963 | 964 |
| 964 // The text that is currently selected in the plugin. | 965 // The text that is currently selected in the plugin. |
| 965 base::string16 selected_text_; | 966 base::string16 selected_text_; |
| 966 | 967 |
| 967 // The most recently committed texture. This is kept around in case the layer | 968 // The most recently committed texture. This is kept around in case the layer |
| 968 // needs to be regenerated. | 969 // needs to be regenerated. |
| 969 cc::TextureMailbox committed_texture_; | 970 cc::TextureMailbox committed_texture_; |
| 970 | 971 |
| 972 // The Graphics3D that produced the most recently committed texture. |
| 973 scoped_refptr<PPB_Graphics3D_Impl> committed_texture_graphics_3d_; |
| 974 |
| 971 gpu::SyncToken committed_texture_consumed_sync_token_; | 975 gpu::SyncToken committed_texture_consumed_sync_token_; |
| 972 | 976 |
| 973 // Holds the number of references |texture_layer_| has to any given | 977 // Holds the number of references |texture_layer_| has to any given |
| 974 // cc::TextureMailbox. | 978 // cc::TextureMailbox. |
| 975 // We expect there to be no more than 10 textures in use at a time. A | 979 // We expect there to be no more than 10 textures in use at a time. A |
| 976 // std::vector will have better performance than a std::map. | 980 // std::vector will have better performance than a std::map. |
| 977 using TextureMailboxRefCount = std::pair<cc::TextureMailbox, int>; | 981 using TextureMailboxRefCount = std::pair<cc::TextureMailbox, int>; |
| 978 std::vector<TextureMailboxRefCount> texture_ref_counts_; | 982 std::vector<TextureMailboxRefCount> texture_ref_counts_; |
| 979 | 983 |
| 980 bool initialized_; | 984 bool initialized_; |
| 981 | 985 |
| 982 // We use a weak ptr factory for scheduling DidChangeView events so that we | 986 // We use a weak ptr factory for scheduling DidChangeView events so that we |
| 983 // can tell whether updates are pending and consolidate them. When there's | 987 // can tell whether updates are pending and consolidate them. When there's |
| 984 // already a weak ptr pending (HasWeakPtrs is true), code should update the | 988 // already a weak ptr pending (HasWeakPtrs is true), code should update the |
| 985 // view_data_ but not send updates. This also allows us to cancel scheduled | 989 // view_data_ but not send updates. This also allows us to cancel scheduled |
| 986 // view change events. | 990 // view change events. |
| 987 base::WeakPtrFactory<PepperPluginInstanceImpl> view_change_weak_ptr_factory_; | 991 base::WeakPtrFactory<PepperPluginInstanceImpl> view_change_weak_ptr_factory_; |
| 988 base::WeakPtrFactory<PepperPluginInstanceImpl> weak_factory_; | 992 base::WeakPtrFactory<PepperPluginInstanceImpl> weak_factory_; |
| 989 | 993 |
| 990 DISALLOW_COPY_AND_ASSIGN(PepperPluginInstanceImpl); | 994 DISALLOW_COPY_AND_ASSIGN(PepperPluginInstanceImpl); |
| 991 }; | 995 }; |
| 992 | 996 |
| 993 } // namespace content | 997 } // namespace content |
| 994 | 998 |
| 995 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ | 999 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ |
| OLD | NEW |