| 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 WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_2D_IMPL_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_2D_IMPL_H_ |
| 6 #define WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_2D_IMPL_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_2D_IMPL_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 // PPB_Graphics2D functions. | 44 // PPB_Graphics2D functions. |
| 45 virtual PP_Bool Describe(PP_Size* size, PP_Bool* is_always_opaque) OVERRIDE; | 45 virtual PP_Bool Describe(PP_Size* size, PP_Bool* is_always_opaque) OVERRIDE; |
| 46 virtual void PaintImageData(PP_Resource image_data, | 46 virtual void PaintImageData(PP_Resource image_data, |
| 47 const PP_Point* top_left, | 47 const PP_Point* top_left, |
| 48 const PP_Rect* src_rect) OVERRIDE; | 48 const PP_Rect* src_rect) OVERRIDE; |
| 49 virtual void Scroll(const PP_Rect* clip_rect, | 49 virtual void Scroll(const PP_Rect* clip_rect, |
| 50 const PP_Point* amount) OVERRIDE; | 50 const PP_Point* amount) OVERRIDE; |
| 51 virtual void ReplaceContents(PP_Resource image_data) OVERRIDE; | 51 virtual void ReplaceContents(PP_Resource image_data) OVERRIDE; |
| 52 virtual int32_t Flush( | 52 virtual int32_t Flush( |
| 53 scoped_refptr< ::ppapi::TrackedCallback> callback) OVERRIDE; | 53 scoped_refptr< ::ppapi::TrackedCallback> callback) OVERRIDE; |
| 54 virtual bool SetScale(float scale) OVERRIDE; |
| 55 virtual float GetScale() OVERRIDE; |
| 54 | 56 |
| 55 bool ReadImageData(PP_Resource image, const PP_Point* top_left); | 57 bool ReadImageData(PP_Resource image, const PP_Point* top_left); |
| 56 | 58 |
| 57 // Assciates this device with the given plugin instance. You can pass NULL to | 59 // Assciates this device with the given plugin instance. You can pass NULL to |
| 58 // clear the existing device. Returns true on success. In this case, a | 60 // clear the existing device. Returns true on success. In this case, a |
| 59 // repaint of the page will also be scheduled. Failure means that the device | 61 // repaint of the page will also be scheduled. Failure means that the device |
| 60 // is already bound to a different instance, and nothing will happen. | 62 // is already bound to a different instance, and nothing will happen. |
| 61 bool BindToInstance(PluginInstance* new_instance); | 63 bool BindToInstance(PluginInstance* new_instance); |
| 62 | 64 |
| 63 // Paints the current backing store to the web page. | 65 // Paints the current backing store to the web page. |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 | 180 |
| 179 // When doing offscreen flushes, we issue a task that issues the callback | 181 // When doing offscreen flushes, we issue a task that issues the callback |
| 180 // later. This is set when one of those tasks is pending so that we can | 182 // later. This is set when one of those tasks is pending so that we can |
| 181 // enforce the "only one pending flush at a time" constraint in the API. | 183 // enforce the "only one pending flush at a time" constraint in the API. |
| 182 bool offscreen_flush_pending_; | 184 bool offscreen_flush_pending_; |
| 183 | 185 |
| 184 // Set to true if the plugin declares that this device will always be opaque. | 186 // Set to true if the plugin declares that this device will always be opaque. |
| 185 // This allows us to do more optimized painting in some cases. | 187 // This allows us to do more optimized painting in some cases. |
| 186 bool is_always_opaque_; | 188 bool is_always_opaque_; |
| 187 | 189 |
| 190 // Set to the scale between what the plugin considers to be one pixel and one |
| 191 // DIP |
| 192 float scale_; |
| 193 |
| 188 base::WeakPtrFactory<PPB_Graphics2D_Impl> weak_ptr_factory_; | 194 base::WeakPtrFactory<PPB_Graphics2D_Impl> weak_ptr_factory_; |
| 189 | 195 |
| 190 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics2D_Impl); | 196 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics2D_Impl); |
| 191 }; | 197 }; |
| 192 | 198 |
| 193 } // namespace ppapi | 199 } // namespace ppapi |
| 194 } // namespace webkit | 200 } // namespace webkit |
| 195 | 201 |
| 196 #endif // WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_2D_IMPL_H_ | 202 #endif // WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_2D_IMPL_H_ |
| OLD | NEW |