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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
14 #include "ppapi/c/ppb_graphics_2d.h" | 14 #include "ppapi/c/ppb_graphics_2d.h" |
15 #include "ppapi/host/host_message_context.h" | 15 #include "ppapi/host/host_message_context.h" |
16 #include "ppapi/host/resource_host.h" | 16 #include "ppapi/host/resource_host.h" |
17 #include "third_party/WebKit/public/platform/WebCanvas.h" | 17 #include "third_party/WebKit/public/platform/WebCanvas.h" |
18 | 18 |
| 19 namespace cc { class TextureMailbox; } |
| 20 |
19 namespace gfx { | 21 namespace gfx { |
20 class Point; | 22 class Point; |
21 class Rect; | 23 class Rect; |
22 } | 24 } |
23 | 25 |
24 namespace content { | 26 namespace content { |
25 | 27 |
26 class PepperPluginInstanceImpl; | 28 class PepperPluginInstanceImpl; |
27 class PPB_ImageData_Impl; | 29 class PPB_ImageData_Impl; |
28 class RendererPpapiHost; | 30 class RendererPpapiHost; |
(...skipping 21 matching lines...) Expand all Loading... |
50 // Assciates this device with the given plugin instance. You can pass NULL | 52 // Assciates this device with the given plugin instance. You can pass NULL |
51 // to clear the existing device. Returns true on success. In this case, a | 53 // to clear the existing device. Returns true on success. In this case, a |
52 // repaint of the page will also be scheduled. Failure means that the device | 54 // repaint of the page will also be scheduled. Failure means that the device |
53 // is already bound to a different instance, and nothing will happen. | 55 // is already bound to a different instance, and nothing will happen. |
54 bool BindToInstance(PepperPluginInstanceImpl* new_instance); | 56 bool BindToInstance(PepperPluginInstanceImpl* new_instance); |
55 // Paints the current backing store to the web page. | 57 // Paints the current backing store to the web page. |
56 void Paint(WebKit::WebCanvas* canvas, | 58 void Paint(WebKit::WebCanvas* canvas, |
57 const gfx::Rect& plugin_rect, | 59 const gfx::Rect& plugin_rect, |
58 const gfx::Rect& paint_rect); | 60 const gfx::Rect& paint_rect); |
59 | 61 |
| 62 bool PrepareTextureMailbox(cc::TextureMailbox* mailbox); |
| 63 |
60 // Notifications about the view's progress painting. See PluginInstance. | 64 // Notifications about the view's progress painting. See PluginInstance. |
61 // These messages are used to send Flush callbacks to the plugin. | 65 // These messages are used to send Flush callbacks to the plugin. |
62 void ViewWillInitiatePaint(); | 66 void ViewWillInitiatePaint(); |
63 void ViewInitiatedPaint(); | 67 void ViewInitiatedPaint(); |
64 void ViewFlushedPaint(); | 68 void ViewFlushedPaint(); |
65 | 69 |
66 void SetScale(float scale); | 70 void SetScale(float scale); |
67 float GetScale() const; | 71 float GetScale() const; |
68 bool IsAlwaysOpaque() const; | 72 bool IsAlwaysOpaque() const; |
69 PPB_ImageData_Impl* ImageData(); | 73 PPB_ImageData_Impl* ImageData(); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 // Set to the scale between what the plugin considers to be one pixel and one | 166 // Set to the scale between what the plugin considers to be one pixel and one |
163 // DIP | 167 // DIP |
164 float scale_; | 168 float scale_; |
165 | 169 |
166 base::WeakPtrFactory<PepperGraphics2DHost> weak_ptr_factory_; | 170 base::WeakPtrFactory<PepperGraphics2DHost> weak_ptr_factory_; |
167 | 171 |
168 ppapi::host::ReplyMessageContext flush_reply_context_; | 172 ppapi::host::ReplyMessageContext flush_reply_context_; |
169 | 173 |
170 bool is_running_in_process_; | 174 bool is_running_in_process_; |
171 | 175 |
| 176 bool texture_mailbox_modified_; |
| 177 |
172 friend class PepperGraphics2DHostTest; | 178 friend class PepperGraphics2DHostTest; |
173 DISALLOW_COPY_AND_ASSIGN(PepperGraphics2DHost); | 179 DISALLOW_COPY_AND_ASSIGN(PepperGraphics2DHost); |
174 }; | 180 }; |
175 | 181 |
176 } // namespace content | 182 } // namespace content |
177 | 183 |
178 #endif // CONTENT_RENDERER_PEPPER_PEPPER_GRAPHICS_2D_HOST_H_ | 184 #endif // CONTENT_RENDERER_PEPPER_PEPPER_GRAPHICS_2D_HOST_H_ |
OLD | NEW |