New issue
Advanced search Search tips

Issue 907897 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Task



Sign in to add a comment

Implement CC-side work for off-thread paint worklet

Project Member Reported by xidac...@chromium.org, Nov 22

Issue description

Labels: -Type-Bug Type-Task
Project Member

Comment 2 by bugdroid1@chromium.org, Dec 5

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/cd7c518a6252f8cc4797337c0757e0daf274775c

commit cd7c518a6252f8cc4797337c0757e0daf274775c
Author: Xida Chen <xidachen@chromium.org>
Date: Wed Dec 05 19:40:32 2018

Add paint_worklet_input_ to cc::PaintImage

When Blink paints, it will create an Image if it is by CSS Paint.
When this image is embedded in a display item list and passed to cc,
it would be a cc::PaintImage.

This CL makes a cc::PaintImage keeps a scoped_refptr to a PaintWorkletInput,
which contains all the input parameters that are necessary to execute
JS paint callbacks. Note that the PaintWorkletInput is a pure interface,
so for testing purpose, we create a class TestPaintWorkletInput.

Bug: 907897
Change-Id: I5f8562eaaf747fc6da723de11f0d668027f4469d
Reviewed-on: https://chromium-review.googlesource.com/c/1348259
Commit-Queue: Xida Chen <xidachen@chromium.org>
Reviewed-by: David Bokan <bokan@chromium.org>
Reviewed-by: vmpstr <vmpstr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#614064}
[modify] https://crrev.com/cd7c518a6252f8cc4797337c0757e0daf274775c/cc/BUILD.gn
[modify] https://crrev.com/cd7c518a6252f8cc4797337c0757e0daf274775c/cc/paint/BUILD.gn
[modify] https://crrev.com/cd7c518a6252f8cc4797337c0757e0daf274775c/cc/paint/discardable_image_map_unittest.cc
[add] https://crrev.com/cd7c518a6252f8cc4797337c0757e0daf274775c/cc/paint/layer_tree_painter.h
[modify] https://crrev.com/cd7c518a6252f8cc4797337c0757e0daf274775c/cc/paint/paint_image.h
[modify] https://crrev.com/cd7c518a6252f8cc4797337c0757e0daf274775c/cc/paint/paint_image_builder.cc
[modify] https://crrev.com/cd7c518a6252f8cc4797337c0757e0daf274775c/cc/paint/paint_image_builder.h
[add] https://crrev.com/cd7c518a6252f8cc4797337c0757e0daf274775c/cc/test/test_paint_worklet_input.cc
[add] https://crrev.com/cd7c518a6252f8cc4797337c0757e0daf274775c/cc/test/test_paint_worklet_input.h
[delete] https://crrev.com/193cdaa184451987cd55193a89576c5ca5c4c0f6/cc/trees/layer_tree_painter.h
[modify] https://crrev.com/cd7c518a6252f8cc4797337c0757e0daf274775c/third_party/blink/renderer/platform/graphics/platform_paint_worklet_input.h

Project Member

Comment 3 by bugdroid1@chromium.org, Dec 7

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b1ebfa7b255bd996cf5f0a467df3d5b903d88fe8

commit b1ebfa7b255bd996cf5f0a467df3d5b903d88fe8
Author: Xida Chen <xidachen@chromium.org>
Date: Fri Dec 07 16:48:32 2018

Make DiscardableImageGenerator works on PaintImages backed by PaintWorklet

This CL adds a AddPaintWorkletImage which is used in the
GatherDiscardableImages when we update a display item list after
recording. Essentially this makes the recording source aware of a
cc::PaintImage that is backed by a PaintWorkeltInput.

Two unit test are added to make sure the correctness.

Bug: 907897
Change-Id: I2144a5c729e41b15ae4083ae3b8fcaf4a2ea204d
Reviewed-on: https://chromium-review.googlesource.com/c/1365878
Reviewed-by: vmpstr <vmpstr@chromium.org>
Commit-Queue: Xida Chen <xidachen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#614725}
[modify] https://crrev.com/b1ebfa7b255bd996cf5f0a467df3d5b903d88fe8/cc/paint/discardable_image_map.cc
[modify] https://crrev.com/b1ebfa7b255bd996cf5f0a467df3d5b903d88fe8/cc/paint/paint_image.h
[modify] https://crrev.com/b1ebfa7b255bd996cf5f0a467df3d5b903d88fe8/cc/raster/raster_source_unittest.cc
[modify] https://crrev.com/b1ebfa7b255bd996cf5f0a467df3d5b903d88fe8/cc/test/skia_common.cc
[modify] https://crrev.com/b1ebfa7b255bd996cf5f0a467df3d5b903d88fe8/cc/test/skia_common.h

Project Member

Comment 4 by bugdroid1@chromium.org, Dec 18

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/41d803dd92f5ecf9b855700048d8275800b84f65

commit 41d803dd92f5ecf9b855700048d8275800b84f65
Author: Xida Chen <xidachen@chromium.org>
Date: Tue Dec 18 19:57:56 2018

Create raster task for off-thread paint worklet

This CL creates a raster task for paint worklet. In this CL, we built
the framework only, therefore the task is an empty task. In the future,
the task will dispatch JS paint callbacks to the worklet thread and
produces the paint records.

We added a unit to make sure that the task is successfully created.

Bug: 907897
Change-Id: I9f45f9fac91b27263bde5beb0a18b7e0292dd1d3
Reviewed-on: https://chromium-review.googlesource.com/c/1348860
Commit-Queue: Xida Chen <xidachen@chromium.org>
Reviewed-by: vmpstr <vmpstr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#617598}
[modify] https://crrev.com/41d803dd92f5ecf9b855700048d8275800b84f65/cc/BUILD.gn
[modify] https://crrev.com/41d803dd92f5ecf9b855700048d8275800b84f65/cc/tiles/image_controller.cc
[modify] https://crrev.com/41d803dd92f5ecf9b855700048d8275800b84f65/cc/tiles/image_controller.h
[modify] https://crrev.com/41d803dd92f5ecf9b855700048d8275800b84f65/cc/tiles/image_controller_unittest.cc
[add] https://crrev.com/41d803dd92f5ecf9b855700048d8275800b84f65/cc/tiles/paint_worklet_image_cache.cc
[add] https://crrev.com/41d803dd92f5ecf9b855700048d8275800b84f65/cc/tiles/paint_worklet_image_cache.h
[add] https://crrev.com/41d803dd92f5ecf9b855700048d8275800b84f65/cc/tiles/paint_worklet_image_cache_unittest.cc
[modify] https://crrev.com/41d803dd92f5ecf9b855700048d8275800b84f65/cc/tiles/tile_manager.cc

Project Member

Comment 5 by bugdroid1@chromium.org, Dec 21

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ec61008186b42e7ed6ea651e2e0d5ef67c653c51

commit ec61008186b42e7ed6ea651e2e0d5ef67c653c51
Author: Xida Chen <xidachen@chromium.org>
Date: Fri Dec 21 21:26:49 2018

[Code health] Rename ImageController::GetTasksFor*

This CL renames ImageController::GetTasksForImagesAndRef to
ConvertNonPaintWorkletImagesToTasks, and the GetTasksForPaintWorkletImages
to ConvertPaintWorkletImagesToTasks, which is more clear what the
function is doing.

This Cl shold not introduce any behavior change.

Bug: 907897
Change-Id: I6be1db8fa61ee58588fa9507f6b82f7570a267ec
Reviewed-on: https://chromium-review.googlesource.com/c/1383539
Reviewed-by: vmpstr <vmpstr@chromium.org>
Commit-Queue: Xida Chen <xidachen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#618607}
[modify] https://crrev.com/ec61008186b42e7ed6ea651e2e0d5ef67c653c51/cc/tiles/image_controller.cc
[modify] https://crrev.com/ec61008186b42e7ed6ea651e2e0d5ef67c653c51/cc/tiles/image_controller.h
[modify] https://crrev.com/ec61008186b42e7ed6ea651e2e0d5ef67c653c51/cc/tiles/image_controller_unittest.cc
[modify] https://crrev.com/ec61008186b42e7ed6ea651e2e0d5ef67c653c51/cc/tiles/tile_manager.cc

Project Member

Comment 6 by bugdroid1@chromium.org, Jan 16

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b2875918af18cb2d2a7407a8ac9c177e7648d831

commit b2875918af18cb2d2a7407a8ac9c177e7648d831
Author: Xida Chen <xidachen@chromium.org>
Date: Wed Jan 16 04:53:24 2019

[OT-PW]Create PaintWorkletImageProvider class

In our current implementation, the connection between ImageDecodeCache
and its rasterization is an ImageProvider. To be more specific, the
RasterTaskImpl takes a PlaybackImageProvider which is specifically
designed for ImageDecodeCache. That ImageProvider is given to the
PlaybackSettings, which is passed all the way to the
RasterSource::PlaybackToCanvas.

To be consistent with the current implementation, this CL creates
a PaintWorkletImageProvider class, specifically designed for the
PaintWorkletImageCache, which will be eventually passed all the way
to the RasterSource::PlaybackToCanvas.

Bug: 907897
Change-Id: I2cdefd6eb3b6daeb9b47162015a834c0f4b01c2f
Reviewed-on: https://chromium-review.googlesource.com/c/1409607
Reviewed-by: vmpstr <vmpstr@chromium.org>
Commit-Queue: Xida Chen <xidachen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#623111}
[modify] https://crrev.com/b2875918af18cb2d2a7407a8ac9c177e7648d831/cc/BUILD.gn
[add] https://crrev.com/b2875918af18cb2d2a7407a8ac9c177e7648d831/cc/raster/paint_worklet_image_provider.cc
[add] https://crrev.com/b2875918af18cb2d2a7407a8ac9c177e7648d831/cc/raster/paint_worklet_image_provider.h
[modify] https://crrev.com/b2875918af18cb2d2a7407a8ac9c177e7648d831/cc/raster/raster_source.h
[modify] https://crrev.com/b2875918af18cb2d2a7407a8ac9c177e7648d831/cc/tiles/image_controller.h
[modify] https://crrev.com/b2875918af18cb2d2a7407a8ac9c177e7648d831/cc/tiles/tile_manager.cc

Project Member

Comment 7 by bugdroid1@chromium.org, Jan 18 (4 days ago)

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4f971db3122711e9f7880de9e2272489db376b24

commit 4f971db3122711e9f7880de9e2272489db376b24
Author: Xida Chen <xidachen@chromium.org>
Date: Fri Jan 18 22:50:04 2019

Plumbing PaintWorkletImageProvider to PlaybackParam

The PaintWorkletImageProvider is a bridge between PaintWorkletImageCache
and its rasterization.

Currently, a PaintWorkletImageProvider instance is created at
TileManager::CreateRasterTask and given to the RasterTaskImpl. At
RasterTaskImpl::RunOnWorkerThread, we should pass this provider all the
way to the PlaybackParams, which is used in PaintOpBuffer::Playback.
This CL does the plumbing.

Bug: 907897
Change-Id: Ice75b134bc8ce3cffb9ebd0494492ea3cbaad08a
Reviewed-on: https://chromium-review.googlesource.com/c/1418524
Reviewed-by: vmpstr <vmpstr@chromium.org>
Commit-Queue: Xida Chen <xidachen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#624327}
[modify] https://crrev.com/4f971db3122711e9f7880de9e2272489db376b24/cc/paint/display_item_list.cc
[modify] https://crrev.com/4f971db3122711e9f7880de9e2272489db376b24/cc/paint/display_item_list.h
[modify] https://crrev.com/4f971db3122711e9f7880de9e2272489db376b24/cc/paint/paint_op_buffer.cc
[modify] https://crrev.com/4f971db3122711e9f7880de9e2272489db376b24/cc/paint/paint_op_buffer.h
[modify] https://crrev.com/4f971db3122711e9f7880de9e2272489db376b24/cc/raster/raster_source.cc
[modify] https://crrev.com/4f971db3122711e9f7880de9e2272489db376b24/cc/raster/raster_source.h
[modify] https://crrev.com/4f971db3122711e9f7880de9e2272489db376b24/cc/test/fake_raster_source.cc
[modify] https://crrev.com/4f971db3122711e9f7880de9e2272489db376b24/cc/test/fake_raster_source.h

Sign in to add a comment