Index: webkit/plugins/ppapi/ppb_graphics_2d_impl.h |
diff --git a/webkit/plugins/ppapi/ppb_graphics_2d_impl.h b/webkit/plugins/ppapi/ppb_graphics_2d_impl.h |
index cec39c61e5e24785525c456a9a8fe03adfd980d7..277fc5cb6556be0d96d20bc768cf407107b09480 100644 |
--- a/webkit/plugins/ppapi/ppb_graphics_2d_impl.h |
+++ b/webkit/plugins/ppapi/ppb_graphics_2d_impl.h |
@@ -15,8 +15,10 @@ |
#include "ppapi/shared_impl/tracked_callback.h" |
#include "ppapi/thunk/ppb_graphics_2d_api.h" |
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCanvas.h" |
+#include "webkit/plugins/webkit_plugins_export.h" |
namespace gfx { |
+class Point; |
class Rect; |
} |
@@ -75,6 +77,15 @@ class PPB_Graphics2D_Impl : public ::ppapi::Resource, |
PPB_ImageData_Impl* image_data() { return image_data_.get(); } |
+ // Scale |op_rect| to logical pixels, taking care to include partially- |
+ // covered logical pixels (aka DIPs). Also scale optional |delta| to logical |
+ // pixels as well for scrolling cases. Returns false for scrolling cases where |
+ // scaling either |op_rect| or |delta| would require scrolling to fall back to |
+ // invalidation due to rounding errors, true otherwise. |
+ WEBKIT_PLUGINS_EXPORT static bool ConvertToLogicalPixels(float scale, |
+ gfx::Rect* op_rect, |
+ gfx::Point* delta); |
+ |
private: |
explicit PPB_Graphics2D_Impl(PP_Instance instance); |