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_HOST_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_COMPOSITOR_HOST_H_ |
6 #define CONTENT_RENDERER_PEPPER_PEPPER_COMPOSITOR_HOST_H_ | 6 #define CONTENT_RENDERER_PEPPER_PEPPER_COMPOSITOR_HOST_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" |
11 #include "ppapi/host/host_message_context.h" | 11 #include "ppapi/host/host_message_context.h" |
12 #include "ppapi/host/resource_host.h" | 12 #include "ppapi/host/resource_host.h" |
13 #include "ppapi/shared_impl/compositor_layer_data.h" | 13 #include "ppapi/shared_impl/compositor_layer_data.h" |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 class SharedMemory; | 16 class SharedMemory; |
17 } // namespace | 17 } // namespace |
18 | 18 |
19 namespace cc { | 19 namespace cc { |
20 class Layer; | 20 class Layer; |
21 class LayerSettings; | |
21 class SharedBitmap; | 22 class SharedBitmap; |
22 } // namespace cc | 23 } // namespace cc |
23 | 24 |
24 namespace content { | 25 namespace content { |
25 | 26 |
26 class PepperPluginInstanceImpl; | 27 class PepperPluginInstanceImpl; |
27 class RendererPpapiHost; | 28 class RendererPpapiHost; |
28 | 29 |
29 class PepperCompositorHost : public ppapi::host::ResourceHost { | 30 class PepperCompositorHost : public ppapi::host::ResourceHost { |
30 public: | 31 public: |
31 PepperCompositorHost(RendererPpapiHost* host, | 32 PepperCompositorHost(RendererPpapiHost* host, |
32 PP_Instance instance, | 33 PP_Instance instance, |
33 PP_Resource resource); | 34 PP_Resource resource); |
34 // Associates this device with the given plugin instance. You can pass NULL | 35 // Associates this device with the given plugin instance. You can pass NULL |
35 // to clear the existing device. Returns true on success. In this case, a | 36 // to clear the existing device. Returns true on success. In this case, a |
36 // repaint of the page will also be scheduled. Failure means that the device | 37 // repaint of the page will also be scheduled. Failure means that the device |
37 // is already bound to a different instance, and nothing will happen. | 38 // is already bound to a different instance, and nothing will happen. |
38 bool BindToInstance(PepperPluginInstanceImpl* new_instance); | 39 bool BindToInstance(PepperPluginInstanceImpl* new_instance); |
39 | 40 |
40 const scoped_refptr<cc::Layer> layer() { return layer_; }; | 41 const scoped_refptr<cc::Layer> layer() { return layer_; }; |
41 | 42 |
42 void ViewInitiatedPaint(); | 43 void ViewInitiatedPaint(); |
43 | 44 |
45 static const cc::LayerSettings& PepperLayerSettings(); | |
piman
2015/05/11 21:31:24
Pepper should use the same settings as WebLayerImp
| |
46 static void SetPepperLayerSettings(const cc::LayerSettings& settings); | |
47 | |
44 private: | 48 private: |
45 ~PepperCompositorHost() override; | 49 ~PepperCompositorHost() override; |
46 | 50 |
47 void ImageReleased(int32_t id, | 51 void ImageReleased(int32_t id, |
48 scoped_ptr<base::SharedMemory> shared_memory, | 52 scoped_ptr<base::SharedMemory> shared_memory, |
49 scoped_ptr<cc::SharedBitmap> bitmap, | 53 scoped_ptr<cc::SharedBitmap> bitmap, |
50 uint32_t sync_point, | 54 uint32_t sync_point, |
51 bool is_lost); | 55 bool is_lost); |
52 void ResourceReleased(int32_t id, | 56 void ResourceReleased(int32_t id, |
53 uint32_t sync_point, | 57 uint32_t sync_point, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
94 ppapi::host::ReplyMessageContext commit_layers_reply_context_; | 98 ppapi::host::ReplyMessageContext commit_layers_reply_context_; |
95 | 99 |
96 base::WeakPtrFactory<PepperCompositorHost> weak_factory_; | 100 base::WeakPtrFactory<PepperCompositorHost> weak_factory_; |
97 | 101 |
98 DISALLOW_COPY_AND_ASSIGN(PepperCompositorHost); | 102 DISALLOW_COPY_AND_ASSIGN(PepperCompositorHost); |
99 }; | 103 }; |
100 | 104 |
101 } // namespace content | 105 } // namespace content |
102 | 106 |
103 #endif // CONTENT_RENDERER_PEPPER_PEPPER_COMPOSITOR_HOST_H_ | 107 #endif // CONTENT_RENDERER_PEPPER_PEPPER_COMPOSITOR_HOST_H_ |
OLD | NEW |