Use paint record to back ImageSkiaRep
Currently ImageSkiaReps are backed by SkBitmaps and cc::PaintImages. While cc::PaintImages are drawables, they are sourced from the SkBitmaps provided to the constructor. This means images that are sourced from drawables, such as our vector icons, are rasterized into bitmaps first and then stored as ImageSkiaReps. This rasterization takes place on the UI thread. This patch makes cc::PaintRecord as the backing store for ImageSkiaReps. cc::PaintRecord are drawables and can be initialized with an SkBitmap if needed. Having images stored this way means drawables like vector icons dont need to be rasterized on the UI thread. Their rasterization will be managed by cc or even the GPU in case of OOPR. This also removes the constraint that ImageSkias are a rasterized source of image. It also gives a way to add more drawable sources(CanvasImageSources) like lottie. This feature is hidden behind a feature flag UsePaintRecordForImageSkia. Bug: 882507 Change-Id: Id4a6500ba0e12da382e95d59e5fa8bc5642082ab Component: ImageSkiaRep, gfx, Image, Image Skia Reviewed-on: https://chromium-review.googlesource.com/c/1227488Reviewed-by:danakj <danakj@chromium.org> Reviewed-by:
Khushal <khushalsagar@chromium.org> Reviewed-by:
Scott Violet <sky@chromium.org> Reviewed-by:
Mitsuru Oshima <oshima@chromium.org> Commit-Queue: Malay Keshav <malaykeshav@chromium.org> Cr-Commit-Position: refs/heads/master@{#596402}
Showing
Please register or sign in to comment