Index: include/core/SkCanvas.h |
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h |
index 5bdf84d58bdc72f4b97527995bac4adb188f4f59..b2c77ef82787ab63d7de864c75f317641b624989 100644 |
--- a/include/core/SkCanvas.h |
+++ b/include/core/SkCanvas.h |
@@ -283,6 +283,30 @@ public: |
int x, int y, |
Config8888 config8888 = kNative_Premul_Config8888); |
+ /** |
+ * This method affects the pixels in the base-layer, and operates in pixel coordinates, |
+ * ignoring the matrix and clip. |
+ * |
+ * The specified ImageInfo and (x,y) offset specifies a rectangle: target. |
+ * |
+ * target.setXYWH(x, y, info.width(), info.height()); |
+ * |
+ * Target is intersected with the bounds of the base-layer. If this intersection is not empty, |
+ * then we have two sets of pixels (of equal size), the "src" specified by info+pixels+rowBytes |
+ * and the "dst" by the canvas' backend. Replace the dst pixels with the corresponding src |
+ * pixels, performing any colortype/alphatype transformations needed (in the case where the |
robertphillips
2014/03/05 23:19:19
missing ')'
reed1
2014/03/06 16:49:48
Done.
|
+ * src and dst have different colortypes or alphatypes. |
+ * |
+ * This call can fail, returning false, for several reasons: |
+ * - If the src colortype/alphatype cannot be converted to the canvas' types |
+ * - If this canvas is not backed by pixels (e.g. picture or PDF) |
+ */ |
+ bool writePixels(const SkImageInfo&, const void* pixels, size_t rowBytes, int x, int y); |
+ |
+ bool writePixels(const SkImageInfo& info, const void* pixels, size_t rowBytes) { |
bsalomon
2014/03/05 21:08:32
is this one useful?
reed1
2014/03/06 16:49:48
No. Removed.
|
+ return this->writePixels(info, pixels, rowBytes, 0, 0); |
+ } |
+ |
/////////////////////////////////////////////////////////////////////////// |
enum SaveFlags { |