What the difference between SkImage/SkPicture/SkCanvas/SkSurface?

4,032 views
Skip to first unread message

xin...@intel.com

unread,
May 19, 2017, 7:03:59 PM5/19/17
to skia-discuss
Any brief sample to tell the differences?

xin...@intel.com

unread,
May 19, 2017, 7:04:28 PM5/19/17
to skia-discuss
add SkBitmap.

Hal Canary

unread,
May 19, 2017, 7:37:30 PM5/19/17
to skia-discuss
Image:. A read-only source of pixels.  May refer to encoded data.

Surface: A destination for drawing, either CPU or GPU.

Bitmap: before Surface and Image, was a source and a destination for drawing. Image/Source allows for more optimizationa.

Canvas: the abstract drawing interface.  Can point at a Surface, a Picture recorder, or Document.

Picture: a sequence of drawing commands; i.e. a command buffer







--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to skia-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/skia-discuss.
For more options, visit https://groups.google.com/d/optout.

Peter Verswyvelen

unread,
Jan 10, 2020, 6:19:16 AM1/10/20
to skia-discuss
Is SkBitmap guaranteed to use the CPU backend?

For server side software rendering, would it be better to use SkBitmap for both reading and writing, or a separate SkSurface with raster backend and making a snapshot to encode the image? Wouldn’t the latter consume twice the memory and be slower because of copying? Some of our bitmaps are 20K by 20k pixels, so that matters...

 

On Saturday, May 20, 2017 at 1:37:30 AM UTC+2, Hal Canary wrote:
Image:. A read-only source of pixels.  May refer to encoded data.

Surface: A destination for drawing, either CPU or GPU.

Bitmap: before Surface and Image, was a source and a destination for drawing. Image/Source allows for more optimizationa.

Canvas: the abstract drawing interface.  Can point at a Surface, a Picture recorder, or Document.

Picture: a sequence of drawing commands; i.e. a command buffer






On May 19, 2017 7:04 PM, <xin...@intel.com> wrote:
add SkBitmap.

On Saturday, May 20, 2017 at 7:03:59 AM UTC+8, xin...@intel.com wrote:
Any brief sample to tell the differences?

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-d...@googlegroups.com.

Mike Reed

unread,
Jan 10, 2020, 8:29:06 AM1/10/20
to skia-d...@googlegroups.com
The snapshot is designed to not make a copy.

draw into the surface -> snapshot image --> encode from the image --> release the image --> draw some more into the surface

We only perform the copy if you try drawing into the surface while still holding onto the snapped image.

To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/c0d0c94a-67eb-44fb-af82-4bdc3ae42c82%40googlegroups.com.

Hal Canary

unread,
Jan 21, 2020, 10:46:03 AM1/21/20
to skia-discuss
On Fri, Jan 10, 2020 at 6:19 AM Peter Verswyvelen <bug...@gmail.com> wrote:
Is SkBitmap guaranteed to use the CPU backend?

Yes. 
Reply all
Reply to author
Forward
0 new messages