| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 // Associates this device with the given plugin instance. You can pass NULL | 44 // Associates this device with the given plugin instance. You can pass NULL |
| 45 // to clear the existing device. Returns true on success. In this case, a | 45 // to clear the existing device. Returns true on success. In this case, a |
| 46 // repaint of the page will also be scheduled. Failure means that the device | 46 // repaint of the page will also be scheduled. Failure means that the device |
| 47 // is already bound to a different instance, and nothing will happen. | 47 // is already bound to a different instance, and nothing will happen. |
| 48 bool BindToInstance(PepperPluginInstanceImpl* new_instance); | 48 bool BindToInstance(PepperPluginInstanceImpl* new_instance); |
| 49 | 49 |
| 50 const scoped_refptr<cc::Layer> layer() { return layer_; }; | 50 const scoped_refptr<cc::Layer> layer() { return layer_; }; |
| 51 | 51 |
| 52 void ViewInitiatedPaint(); | 52 void ViewInitiatedPaint(); |
| 53 | 53 |
| 54 void set_viewport_to_dip_scale(float viewport_to_dip_scale) { |
| 55 DCHECK_LT(0, viewport_to_dip_scale_); |
| 56 viewport_to_dip_scale_ = viewport_to_dip_scale; |
| 57 } |
| 58 |
| 54 private: | 59 private: |
| 55 void ImageReleased(int32_t id, | 60 void ImageReleased(int32_t id, |
| 56 std::unique_ptr<base::SharedMemory> shared_memory, | 61 std::unique_ptr<base::SharedMemory> shared_memory, |
| 57 std::unique_ptr<cc::SharedBitmap> bitmap, | 62 std::unique_ptr<cc::SharedBitmap> bitmap, |
| 58 const gpu::SyncToken& sync_token, | 63 const gpu::SyncToken& sync_token, |
| 59 bool is_lost); | 64 bool is_lost); |
| 60 void ResourceReleased(int32_t id, | 65 void ResourceReleased(int32_t id, |
| 61 const gpu::SyncToken& sync_token, | 66 const gpu::SyncToken& sync_token, |
| 62 bool is_lost); | 67 bool is_lost); |
| 63 void SendCommitLayersReplyIfNecessary(); | 68 void SendCommitLayersReplyIfNecessary(); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 LayerData(const LayerData& other); | 100 LayerData(const LayerData& other); |
| 96 ~LayerData(); | 101 ~LayerData(); |
| 97 | 102 |
| 98 scoped_refptr<cc::Layer> cc_layer; | 103 scoped_refptr<cc::Layer> cc_layer; |
| 99 ppapi::CompositorLayerData pp_layer; | 104 ppapi::CompositorLayerData pp_layer; |
| 100 }; | 105 }; |
| 101 std::vector<LayerData> layers_; | 106 std::vector<LayerData> layers_; |
| 102 | 107 |
| 103 ppapi::host::ReplyMessageContext commit_layers_reply_context_; | 108 ppapi::host::ReplyMessageContext commit_layers_reply_context_; |
| 104 | 109 |
| 110 // The scale between the viewport and dip. This differs in |
| 111 // use-zoom-for-dsf mode where the content is scaled by zooming. |
| 112 float viewport_to_dip_scale_ = 1.0f; |
| 113 |
| 105 base::WeakPtrFactory<PepperCompositorHost> weak_factory_; | 114 base::WeakPtrFactory<PepperCompositorHost> weak_factory_; |
| 106 | 115 |
| 107 DISALLOW_COPY_AND_ASSIGN(PepperCompositorHost); | 116 DISALLOW_COPY_AND_ASSIGN(PepperCompositorHost); |
| 108 }; | 117 }; |
| 109 | 118 |
| 110 } // namespace content | 119 } // namespace content |
| 111 | 120 |
| 112 #endif // CONTENT_RENDERER_PEPPER_PEPPER_COMPOSITOR_HOST_H_ | 121 #endif // CONTENT_RENDERER_PEPPER_PEPPER_COMPOSITOR_HOST_H_ |
| OLD | NEW |