Use unified CanvasResourceProvider
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f913f8dd9fd03078f4c0786c91837dfab07698c7 commit f913f8dd9fd03078f4c0786c91837dfab07698c7 Author: Justin Novosad <junov@chromium.org> Date: Thu Nov 30 17:31:53 2017 Make CanvasResource RefCounted This is a step towards unifying OffscreenCanvasResourceProvider with CanvasResourceProvider, which will eventually allow low latency canvas rendering to use a single buffered GpuMemoryBuffer BUG=788439, 776801 Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Change-Id: Ie9f04e7920e7d74c229c4d45c34c371ab5d06e36 Reviewed-on: https://chromium-review.googlesource.com/800670 Commit-Queue: Justin Novosad <junov@chromium.org> Reviewed-by: Olivia Lai <xlai@chromium.org> Cr-Commit-Position: refs/heads/master@{#520586} [modify] https://crrev.com/f913f8dd9fd03078f4c0786c91837dfab07698c7/third_party/WebKit/Source/platform/graphics/CanvasResource.cpp [modify] https://crrev.com/f913f8dd9fd03078f4c0786c91837dfab07698c7/third_party/WebKit/Source/platform/graphics/CanvasResource.h [modify] https://crrev.com/f913f8dd9fd03078f4c0786c91837dfab07698c7/third_party/WebKit/Source/platform/graphics/CanvasResourceProvider.cpp [modify] https://crrev.com/f913f8dd9fd03078f4c0786c91837dfab07698c7/third_party/WebKit/Source/platform/graphics/CanvasResourceProvider.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/4f6bce25c2f94e59611343ddab1fffcc13f79f07 commit 4f6bce25c2f94e59611343ddab1fffcc13f79f07 Author: Justin Novosad <junov@chromium.org> Date: Tue Dec 05 22:44:49 2017 Move TransferableResource creation to Canvas Resource This change makes it possible to decouple the actions of capturing an animation frame from a canvas and sending it to the compositor. This is a prerequisite for mergin OffscreenCanvasResourceProdiver with CanvasResourceProvider. Bug: 788439, 776801 Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Change-Id: Iaf4563069ede53b1bba8bde5ea8b693d4c1a2b73 Reviewed-on: https://chromium-review.googlesource.com/803945 Commit-Queue: Justin Novosad <junov@chromium.org> Reviewed-by: Olivia Lai <xlai@chromium.org> Cr-Commit-Position: refs/heads/master@{#521868} [modify] https://crrev.com/4f6bce25c2f94e59611343ddab1fffcc13f79f07/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp [modify] https://crrev.com/4f6bce25c2f94e59611343ddab1fffcc13f79f07/third_party/WebKit/Source/platform/graphics/CanvasResource.cpp [modify] https://crrev.com/4f6bce25c2f94e59611343ddab1fffcc13f79f07/third_party/WebKit/Source/platform/graphics/CanvasResource.h [modify] https://crrev.com/4f6bce25c2f94e59611343ddab1fffcc13f79f07/third_party/WebKit/Source/platform/graphics/CanvasResourceProvider.cpp [modify] https://crrev.com/4f6bce25c2f94e59611343ddab1fffcc13f79f07/third_party/WebKit/Source/platform/graphics/CanvasResourceProvider.h [modify] https://crrev.com/4f6bce25c2f94e59611343ddab1fffcc13f79f07/third_party/WebKit/Source/platform/graphics/CanvasResourceTest.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/2e4a432454ac3f04d6c5fa8f17c49ce3026217d6 commit 2e4a432454ac3f04d6c5fa8f17c49ce3026217d6 Author: Justin Novosad <junov@chromium.org> Date: Thu Dec 14 22:37:30 2017 Replace CanvasResource_Skia with CanvasResource_Bitmap This change refactors the existing CanvasResource_Skia to make it store a StaticBitmapImage instead of an SkImage intenally. This simplifies the gpu mailbox management code by re-using the functionality provided by StaticBitmapImage. It also bring the code closer to unifying OffscreenCanvasResourceProvider with CanvasResourceProvider BUG=788439, 776801 TBR=bajones@chromium.org Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Change-Id: Ia57a68e1a61763daa158403e258b89b56a82a6f7 Reviewed-on: https://chromium-review.googlesource.com/820251 Commit-Queue: Justin Novosad <junov@chromium.org> Reviewed-by: Olivia Lai <xlai@chromium.org> Cr-Commit-Position: refs/heads/master@{#524204} [modify] https://crrev.com/2e4a432454ac3f04d6c5fa8f17c49ce3026217d6/third_party/WebKit/Source/modules/vr/VRDisplay.cpp [modify] https://crrev.com/2e4a432454ac3f04d6c5fa8f17c49ce3026217d6/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.cpp [modify] https://crrev.com/2e4a432454ac3f04d6c5fa8f17c49ce3026217d6/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.h [modify] https://crrev.com/2e4a432454ac3f04d6c5fa8f17c49ce3026217d6/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp [modify] https://crrev.com/2e4a432454ac3f04d6c5fa8f17c49ce3026217d6/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp [modify] https://crrev.com/2e4a432454ac3f04d6c5fa8f17c49ce3026217d6/third_party/WebKit/Source/platform/graphics/CanvasResource.cpp [modify] https://crrev.com/2e4a432454ac3f04d6c5fa8f17c49ce3026217d6/third_party/WebKit/Source/platform/graphics/CanvasResource.h [modify] https://crrev.com/2e4a432454ac3f04d6c5fa8f17c49ce3026217d6/third_party/WebKit/Source/platform/graphics/CanvasResourceProvider.cpp [modify] https://crrev.com/2e4a432454ac3f04d6c5fa8f17c49ce3026217d6/third_party/WebKit/Source/platform/graphics/CanvasResourceTest.cpp [modify] https://crrev.com/2e4a432454ac3f04d6c5fa8f17c49ce3026217d6/third_party/WebKit/Source/platform/graphics/GpuMemoryBufferImageCopy.cpp [modify] https://crrev.com/2e4a432454ac3f04d6c5fa8f17c49ce3026217d6/third_party/WebKit/Source/platform/graphics/MailboxTextureHolder.cpp [modify] https://crrev.com/2e4a432454ac3f04d6c5fa8f17c49ce3026217d6/third_party/WebKit/Source/platform/graphics/MailboxTextureHolder.h [modify] https://crrev.com/2e4a432454ac3f04d6c5fa8f17c49ce3026217d6/third_party/WebKit/Source/platform/graphics/OffscreenCanvasResourceProvider.cpp [modify] https://crrev.com/2e4a432454ac3f04d6c5fa8f17c49ce3026217d6/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp [modify] https://crrev.com/2e4a432454ac3f04d6c5fa8f17c49ce3026217d6/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.h [modify] https://crrev.com/2e4a432454ac3f04d6c5fa8f17c49ce3026217d6/third_party/WebKit/Source/platform/graphics/TextureHolder.h [modify] https://crrev.com/2e4a432454ac3f04d6c5fa8f17c49ce3026217d6/third_party/WebKit/Source/platform/graphics/gpu/GraphicsContext3DUtils.cpp [modify] https://crrev.com/2e4a432454ac3f04d6c5fa8f17c49ce3026217d6/third_party/WebKit/Source/platform/graphics/gpu/GraphicsContext3DUtils.h [modify] https://crrev.com/2e4a432454ac3f04d6c5fa8f17c49ce3026217d6/third_party/WebKit/Source/platform/graphics/gpu/ImageLayerBridge.cpp [modify] https://crrev.com/2e4a432454ac3f04d6c5fa8f17c49ce3026217d6/third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContextTest.cpp
This is almost done. There is still a little bit of resource management logic left in OffscreenCanvasResourceProvider, which could easily be folded into CanvasResourceDispatcher.
It seems that this bug is fixed now since apparently offscreen frame dispatcher is using CanvasResourceProvider and CanvasResourceDispatcher. The documentation needs to get updated though: https://cs.chromium.org/chromium/src/third_party/blink/renderer/modules/canvas/offscreencanvas/OffscreenCanvas-commit.md?l=237
Re: #19 That documentation most likely needs to be redone completely.
Comment 1 by xlai@chromium.org
, Oct 20 2017