Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / skia / include / core / SkSurface.h
index 3b7df42..74c5f08 100644 (file)
@@ -68,7 +68,7 @@ public:
     /**
      *  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
@@ -151,8 +151,21 @@ public:
      */
     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() {