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

Unified Diff: ppapi/c/ppb_graphics_2d.h

Issue 6658038: Clarify the behavior of PaintImageData. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/c/ppb_graphics_2d.h
===================================================================
--- ppapi/c/ppb_graphics_2d.h (revision 77054)
+++ ppapi/c/ppb_graphics_2d.h (working copy)
@@ -71,7 +71,8 @@
*
* The given image will be placed at |top_left| from the top left of the
* context's internal backing store. Then the src_rect will be copied into the
- * backing store. This parameter may not be NULL.
+ * backing store. This parameter may not be NULL. This means that the
+ * rectangle being painted will be at src_rect offset by top_left.
*
* The src_rect is specified in the coordinate system of the image being
* painted, not the context. For the common case of copying the entire image,
@@ -83,6 +84,14 @@
* context. Attempting to paint outside of the context will result in an
* error. However, the source bitmap may fall outside the context, as long
* as the src_rect subset of it falls entirely within the context.
+ *
+ * There are two modes most plugins may use for painting. The first is
+ * that you will generate a new ImageData (possibly representing a subset of
+ * your plugin) and then paint it. In this case, you'll set the location of
+ * your painting to top_left and set src_rect to NULL. The second is that
+ * you're generating small invalid regions out of a larger bitmap
+ * representing your entire plugin. In this case, you would set the location
+ * of your image to (0,0) and then set src_rect to the pixels you changed.
*/
void (*PaintImageData)(PP_Resource graphics_2d,
PP_Resource image_data,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698