Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Unified Diff: webkit/plugins/ppapi/ppb_graphics_2d_impl.h

Issue 10704198: Scale to DIPs in ppb_graphics2d_impl for proper invalidation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix a nit Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webkit/plugins/ppapi/ppb_graphics_2d_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | webkit/plugins/ppapi/ppb_graphics_2d_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698