| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_COMPOSITOR_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_COMPOSITOR_H_ |
| 6 #define CONTENT_RENDERER_PEPPER_PEPPER_COMPOSITOR_H_ | 6 #define CONTENT_RENDERER_PEPPER_PEPPER_COMPOSITOR_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 bool BindToInstance(PepperPluginInstanceImpl* new_instance); | 37 bool BindToInstance(PepperPluginInstanceImpl* new_instance); |
| 38 | 38 |
| 39 const scoped_refptr<cc::Layer> layer() { return layer_; }; | 39 const scoped_refptr<cc::Layer> layer() { return layer_; }; |
| 40 | 40 |
| 41 void ViewInitiatedPaint(); | 41 void ViewInitiatedPaint(); |
| 42 void ViewFlushedPaint(); | 42 void ViewFlushedPaint(); |
| 43 | 43 |
| 44 private: | 44 private: |
| 45 virtual ~PepperCompositorHost(); | 45 virtual ~PepperCompositorHost(); |
| 46 | 46 |
| 47 void ImageReleased(int32_t id, |
| 48 const scoped_ptr<base::SharedMemory>& shared_memory, |
| 49 uint32_t sync_point, |
| 50 bool is_lost); |
| 51 void ResourceReleased(int32_t id, |
| 52 uint32_t sync_point, |
| 53 bool is_lost); |
| 54 void SendCommitLayersReplyIfNecessary(); |
| 47 void UpdateLayer(const scoped_refptr<cc::Layer>& layer, | 55 void UpdateLayer(const scoped_refptr<cc::Layer>& layer, |
| 48 const ppapi::CompositorLayerData* old_layer, | 56 const ppapi::CompositorLayerData* old_layer, |
| 49 const ppapi::CompositorLayerData* new_layer, | 57 const ppapi::CompositorLayerData* new_layer, |
| 50 scoped_ptr<base::SharedMemory> image_shm); | 58 scoped_ptr<base::SharedMemory> image_shm); |
| 51 void ResourceReleased(int32_t id, | |
| 52 uint32_t sync_point, | |
| 53 bool is_lost); | |
| 54 void ImageReleased(int32_t id, | |
| 55 const scoped_ptr<base::SharedMemory>& shared_memory, | |
| 56 uint32_t sync_point, | |
| 57 bool is_lost); | |
| 58 | 59 |
| 59 // ResourceMessageHandler overrides: | 60 // ResourceMessageHandler overrides: |
| 60 virtual int32_t OnResourceMessageReceived( | 61 virtual int32_t OnResourceMessageReceived( |
| 61 const IPC::Message& msg, | 62 const IPC::Message& msg, |
| 62 ppapi::host::HostMessageContext* context) OVERRIDE; | 63 ppapi::host::HostMessageContext* context) OVERRIDE; |
| 63 | 64 |
| 64 // ppapi::host::ResourceHost overrides: | 65 // ppapi::host::ResourceHost overrides: |
| 65 virtual bool IsCompositorHost() OVERRIDE; | 66 virtual bool IsCompositorHost() OVERRIDE; |
| 66 | 67 |
| 67 // Message handlers: | 68 // Message handlers: |
| 68 int32_t OnHostMsgCommitLayers( | 69 int32_t OnHostMsgCommitLayers( |
| 69 ppapi::host::HostMessageContext* context, | 70 ppapi::host::HostMessageContext* context, |
| 70 const std::vector<ppapi::CompositorLayerData>& layers, | 71 const std::vector<ppapi::CompositorLayerData>& layers, |
| 71 bool reset); | 72 bool reset); |
| 73 int32_t OnHostMsgRelease(ppapi::host::HostMessageContext* context); |
| 72 | 74 |
| 73 // Non-owning pointer to the plugin instance this context is currently bound | 75 // Non-owning pointer to the plugin instance this context is currently bound |
| 74 // to, if any. If the context is currently unbound, this will be NULL. | 76 // to, if any. If the context is currently unbound, this will be NULL. |
| 75 PepperPluginInstanceImpl* bound_instance_; | 77 PepperPluginInstanceImpl* bound_instance_; |
| 76 | 78 |
| 77 // The toplevel cc::Layer. It is the parent of other cc::Layers. | 79 // The toplevel cc::Layer. It is the parent of other cc::Layers. |
| 78 scoped_refptr<cc::Layer> layer_; | 80 scoped_refptr<cc::Layer> layer_; |
| 79 | 81 |
| 80 // A list of layers. It is used for updating layers' properties in | 82 // A list of layers. It is used for updating layers' properties in |
| 81 // subsequent CommitLayers() calls. | 83 // subsequent CommitLayers() calls. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 92 ppapi::host::ReplyMessageContext commit_layers_reply_context_; | 94 ppapi::host::ReplyMessageContext commit_layers_reply_context_; |
| 93 | 95 |
| 94 base::WeakPtrFactory<PepperCompositorHost> weak_factory_; | 96 base::WeakPtrFactory<PepperCompositorHost> weak_factory_; |
| 95 | 97 |
| 96 DISALLOW_COPY_AND_ASSIGN(PepperCompositorHost); | 98 DISALLOW_COPY_AND_ASSIGN(PepperCompositorHost); |
| 97 }; | 99 }; |
| 98 | 100 |
| 99 } // namespace content | 101 } // namespace content |
| 100 | 102 |
| 101 #endif // CONTENT_RENDERER_PEPPER_PEPPER_COMPOSITOR_H_ | 103 #endif // CONTENT_RENDERER_PEPPER_PEPPER_COMPOSITOR_H_ |
| OLD | NEW |