/**
* Return a new surface using the specified render target.
*/
- static SkSurface* NewRenderTargetDirect(GrContext*, GrRenderTarget*);
+ static SkSurface* NewRenderTargetDirect(GrRenderTarget*);
/**
* Return a new surface whose contents will be drawn to an offscreen
*/
void draw(SkCanvas*, SkScalar x, SkScalar y, const SkPaint*);
+ /**
+ * If the surface has direct access to its pixels (i.e. they are in local
+ * RAM) return the const-address of those pixels, and if not null, return
+ * the ImageInfo and rowBytes. The returned address is only valid while
+ * the surface object is in scope, and no API call is made on the surface
+ * or its canvas.
+ *
+ * On failure, returns NULL and the info and rowBytes parameters are
+ * ignored.
+ */
+ const void* peekPixels(SkImageInfo* info, size_t* rowBytes);
+
protected:
SkSurface(int width, int height);
+ SkSurface(const SkImageInfo&);
// called by subclass if their contents have changed
void dirtyGenerationID() {