| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 // Notifications about the view's progress painting. See PluginInstance. | 78 // Notifications about the view's progress painting. See PluginInstance. |
| 79 // These messages are used to send Flush callbacks to the plugin. | 79 // These messages are used to send Flush callbacks to the plugin. |
| 80 void ViewWillInitiatePaint(); | 80 void ViewWillInitiatePaint(); |
| 81 void ViewInitiatedPaint(); | 81 void ViewInitiatedPaint(); |
| 82 void ViewFlushedPaint(); | 82 void ViewFlushedPaint(); |
| 83 | 83 |
| 84 PPB_ImageData_Impl* image_data() { return image_data_.get(); } | 84 PPB_ImageData_Impl* image_data() { return image_data_.get(); } |
| 85 PluginInstance* bound_instance() const { return bound_instance_; } |
| 85 | 86 |
| 86 // Scale |op_rect| to logical pixels, taking care to include partially- | 87 // Scale |op_rect| to logical pixels, taking care to include partially- |
| 87 // covered logical pixels (aka DIPs). Also scale optional |delta| to logical | 88 // covered logical pixels (aka DIPs). Also scale optional |delta| to logical |
| 88 // pixels as well for scrolling cases. Returns false for scrolling cases where | 89 // pixels as well for scrolling cases. Returns false for scrolling cases where |
| 89 // scaling either |op_rect| or |delta| would require scrolling to fall back to | 90 // scaling either |op_rect| or |delta| would require scrolling to fall back to |
| 90 // invalidation due to rounding errors, true otherwise. | 91 // invalidation due to rounding errors, true otherwise. |
| 91 static bool ConvertToLogicalPixels(float scale, | 92 static bool ConvertToLogicalPixels(float scale, |
| 92 gfx::Rect* op_rect, | 93 gfx::Rect* op_rect, |
| 93 gfx::Point* delta); | 94 gfx::Point* delta); |
| 94 | 95 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 base::WeakPtrFactory<PPB_Graphics2D_Impl> weak_ptr_factory_; | 213 base::WeakPtrFactory<PPB_Graphics2D_Impl> weak_ptr_factory_; |
| 213 | 214 |
| 214 friend class content::PepperGraphics2DHost; | 215 friend class content::PepperGraphics2DHost; |
| 215 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics2D_Impl); | 216 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics2D_Impl); |
| 216 }; | 217 }; |
| 217 | 218 |
| 218 } // namespace ppapi | 219 } // namespace ppapi |
| 219 } // namespace webkit | 220 } // namespace webkit |
| 220 | 221 |
| 221 #endif // WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_2D_IMPL_H_ | 222 #endif // WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_2D_IMPL_H_ |
| OLD | NEW |