Skip to content

Use SKBitmap as a storage for TBitmap data #410

@Torbins

Description

@Torbins

At the moment all canvas implementations in Skia4Delphi use TSkBitmapHandle/TGrBitmapHandle to store bitmap data. These classes are a simple memory buffers, that are external to Skia engine. That is why when FMX needs to copy bitmap data, it uses simple buffer copy on CPU. See method TCanvas.DoCopyBitmap. This is bad for mobile devices and HiDPI screens. If bitmap data was stored in SKBitmap, you could override DoCopyBitmap and use one of SKBitmap constructors to copy data from source SKBitmap. Since copying operation will be happening inside Skia engine, it can optimize it in different ways. There are a lot of other situations where different Skia objects are constructed from buffers in TSkBitmapHandle/TGrBitmapHandle. If these buffers were SKBitmaps, a lot of such operations also could be optimized by Skia engine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions