| 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_GRAPHICS_2D_HOST_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_GRAPHICS_2D_HOST_H_ |
| 6 #define CONTENT_RENDERER_PEPPER_PEPPER_GRAPHICS_2D_HOST_H_ | 6 #define CONTENT_RENDERER_PEPPER_PEPPER_GRAPHICS_2D_HOST_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 // repaint of the page will also be scheduled. Failure means that the device | 70 // repaint of the page will also be scheduled. Failure means that the device |
| 71 // is already bound to a different instance, and nothing will happen. | 71 // is already bound to a different instance, and nothing will happen. |
| 72 bool BindToInstance(PepperPluginInstanceImpl* new_instance); | 72 bool BindToInstance(PepperPluginInstanceImpl* new_instance); |
| 73 // Paints the current backing store to the web page. | 73 // Paints the current backing store to the web page. |
| 74 void Paint(blink::WebCanvas* canvas, | 74 void Paint(blink::WebCanvas* canvas, |
| 75 const gfx::Rect& plugin_rect, | 75 const gfx::Rect& plugin_rect, |
| 76 const gfx::Rect& paint_rect); | 76 const gfx::Rect& paint_rect); |
| 77 | 77 |
| 78 bool PrepareTextureMailbox( | 78 bool PrepareTextureMailbox( |
| 79 cc::TextureMailbox* mailbox, | 79 cc::TextureMailbox* mailbox, |
| 80 scoped_ptr<cc::SingleReleaseCallback>* release_callback); | 80 std::unique_ptr<cc::SingleReleaseCallback>* release_callback); |
| 81 void AttachedToNewLayer(); | 81 void AttachedToNewLayer(); |
| 82 | 82 |
| 83 // Notifications about the view's progress painting. See PluginInstance. | 83 // Notifications about the view's progress painting. See PluginInstance. |
| 84 // These messages are used to send Flush callbacks to the plugin. | 84 // These messages are used to send Flush callbacks to the plugin. |
| 85 void ViewInitiatedPaint(); | 85 void ViewInitiatedPaint(); |
| 86 | 86 |
| 87 void SetScale(float scale); | 87 void SetScale(float scale); |
| 88 float GetScale() const; | 88 float GetScale() const; |
| 89 bool IsAlwaysOpaque() const; | 89 bool IsAlwaysOpaque() const; |
| 90 PPB_ImageData_Impl* ImageData(); | 90 PPB_ImageData_Impl* ImageData(); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 156 |
| 157 // Scale |op_rect| to logical pixels, taking care to include partially- | 157 // Scale |op_rect| to logical pixels, taking care to include partially- |
| 158 // covered logical pixels (aka DIPs). Also scale optional |delta| to logical | 158 // covered logical pixels (aka DIPs). Also scale optional |delta| to logical |
| 159 // pixels as well for scrolling cases. Returns false for scrolling cases where | 159 // pixels as well for scrolling cases. Returns false for scrolling cases where |
| 160 // scaling either |op_rect| or |delta| would require scrolling to fall back to | 160 // scaling either |op_rect| or |delta| would require scrolling to fall back to |
| 161 // invalidation due to rounding errors, true otherwise. | 161 // invalidation due to rounding errors, true otherwise. |
| 162 static bool ConvertToLogicalPixels(float scale, | 162 static bool ConvertToLogicalPixels(float scale, |
| 163 gfx::Rect* op_rect, | 163 gfx::Rect* op_rect, |
| 164 gfx::Point* delta); | 164 gfx::Point* delta); |
| 165 | 165 |
| 166 void ReleaseCallback(scoped_ptr<cc::SharedBitmap> bitmap, | 166 void ReleaseCallback(std::unique_ptr<cc::SharedBitmap> bitmap, |
| 167 const gfx::Size& bitmap_size, | 167 const gfx::Size& bitmap_size, |
| 168 const gpu::SyncToken& sync_token, | 168 const gpu::SyncToken& sync_token, |
| 169 bool lost_resource); | 169 bool lost_resource); |
| 170 | 170 |
| 171 RendererPpapiHost* renderer_ppapi_host_; | 171 RendererPpapiHost* renderer_ppapi_host_; |
| 172 | 172 |
| 173 scoped_refptr<PPB_ImageData_Impl> image_data_; | 173 scoped_refptr<PPB_ImageData_Impl> image_data_; |
| 174 | 174 |
| 175 // Non-owning pointer to the plugin instance this context is currently bound | 175 // Non-owning pointer to the plugin instance this context is currently bound |
| 176 // to, if any. If the context is currently unbound, this will be NULL. | 176 // to, if any. If the context is currently unbound, this will be NULL. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 199 | 199 |
| 200 ppapi::host::ReplyMessageContext flush_reply_context_; | 200 ppapi::host::ReplyMessageContext flush_reply_context_; |
| 201 | 201 |
| 202 bool is_running_in_process_; | 202 bool is_running_in_process_; |
| 203 | 203 |
| 204 bool texture_mailbox_modified_; | 204 bool texture_mailbox_modified_; |
| 205 bool is_using_texture_layer_; | 205 bool is_using_texture_layer_; |
| 206 | 206 |
| 207 // This is a bitmap that was recently released by the compositor and may be | 207 // This is a bitmap that was recently released by the compositor and may be |
| 208 // used to transfer bytes to the compositor again. | 208 // used to transfer bytes to the compositor again. |
| 209 scoped_ptr<cc::SharedBitmap> cached_bitmap_; | 209 std::unique_ptr<cc::SharedBitmap> cached_bitmap_; |
| 210 gfx::Size cached_bitmap_size_; | 210 gfx::Size cached_bitmap_size_; |
| 211 | 211 |
| 212 friend class PepperGraphics2DHostTest; | 212 friend class PepperGraphics2DHostTest; |
| 213 DISALLOW_COPY_AND_ASSIGN(PepperGraphics2DHost); | 213 DISALLOW_COPY_AND_ASSIGN(PepperGraphics2DHost); |
| 214 }; | 214 }; |
| 215 | 215 |
| 216 } // namespace content | 216 } // namespace content |
| 217 | 217 |
| 218 #endif // CONTENT_RENDERER_PEPPER_PEPPER_GRAPHICS_2D_HOST_H_ | 218 #endif // CONTENT_RENDERER_PEPPER_PEPPER_GRAPHICS_2D_HOST_H_ |
| OLD | NEW |