DescriptionImplement SkBaseDevice snapshot support
Implement SkImage snapshots for SkBaseDevices. This way filter source
image, eg. the argument of SkCanvas::drawSprite or the resulting device
of save layer can be converted to a SkImage snapshot.
In later commits, this SkImage can be used as input to the filters.
Decouples the following concepts:
* Previously surface associated, now device associated snapshot SkImage
snapshot
* Surface generation id
For SkBitmapDevice based devices and surfaces, the notification to do
deep copy of the device "backend" (e.g the device backbuffer) is now
SkBitmapDevice::onAccessBitmap and SkBitmapDevice::discard.
For SkGpuDevice based surfaces, each draw operation of the device
checks if the deep copy is needed.
Before, these were intiated upon unneeded SkCanvas::predrawNotify().
(Unneeded, because by definition SkBaseDevice must see all the
modification operations)
For SkBitmapDevice based surfaces, the notification to change
surface generation id is when the device backend bitmap has changed.
This is tracked with SkBitmap generation id.
For SkGpuDevice based surfaces, all device write operations call
SkSurface_Gpu::notifyContentWillChange(), which will trigger surface
generation id change.
Removes redundant SkSurface::notifyContentWillChange(). The contents
change conditions and notifications are internal details of the
subclasses. This call is not useful for Skia clients using SkSurface.
It is also not useful for implementing concrete SkSurface subclasses.
Use new member function SkBaseDevice::newImageSnapshot() instead of
SkBaseDevice::accessBitmap() to refer to the device contents for
filter -related callsites. These callsites will later be modified
to hand the SkImage directly to the filters.
Move canvas->surface association to the device subclasses. This way
the association is more natural:
* One or many canvases refer to one device
* SkCanvas does not know anything about surfaces
* SkBaseDevice does not know anything about surfaces
* One surface-aware device refers to one surfaces
* The surface-aware device knows the concrete type of the surface
(no upcasting)
Bug=skia:3388
Patch Set 1 #Patch Set 2 : #Patch Set 3 : merge with the other patch, clear todos #Patch Set 4 : #Patch Set 5 : #Patch Set 6 : #Patch Set 7 : rebase #Patch Set 8 : rebase #Patch Set 9 : rebase #Patch Set 10 : rebase #Patch Set 11 : rebase #Patch Set 12 : #
Messages
Total messages: 7 (2 generated)
|