`IImage` represents a base interface for raster and vector images. `IBitmap` now implements this interface and `DrawingContext` accepts this interface in `DrawImage`.
The interface defines a `Draw` method which introduces a level of indirection for drawing the image through the image itself.
Renamed `IDrawingContextImpl.DrawImage` to `DrawBitmap` as this only handles drawing bitmap images. `Bitmap` now calls this method directly on the platform implementation.
We're potentially creating a new immutable version of the opacity mask each time the `VisualNode` is updated. Need to implement comparison between mutable and immutable brushes.
Previously we were creating a new render layer for all controls with `Opacity != 1`. This was causing the `Calendar` page in ControlCatalog to render _really_ slowly. Instead, only create a new render layer when `Opacity` is being animated.
Also don't even render controls where `Opacity == 0`.
`VisualBrush`es need to get delegated back to the renderer for
rendering, so added an `IVisualBrushRenderer` interface which is
implemented by the renderers, and pass this when creating drawing
contexts. Only currently implemented/tested for D2D and
`ImmediateRenderer`.
Layers are now calculated by SceneBuilder and stored in Scene. This
means we are no longer accessing `visual.Opacity` from the render thread
(and `VerifyAccess` calls have been placed in AvaloniaObject.GetValue
and friends to ensure this cannot happen). ControlCatalog is now
rendering mostly fine.