New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 776806 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Task

Blocked on:
issue 776826
issue 794194
issue 806066

Blocking:
issue 776800



Sign in to add a comment

Remove ImageBuffer + ImageBufferSurface

Project Member Reported by xlai@chromium.org, Oct 20 2017

Issue description

In favor of the CanvasResourceProvider abstraction
 

Comment 1 by xlai@chromium.org, Oct 20 2017

Blocking: 776800

Comment 2 by xlai@chromium.org, Oct 20 2017

Labels: -Type-Feature Type-Task

Comment 3 by xlai@chromium.org, Nov 15 2017

Status: Started (was: Assigned)
There are lots of classes that use ImageBuffer(Surface) and so this task needs to be done bits by bits.

First and foremost, there are a lot of use cases when Canvas2DLayerBridge diverts a command to HTMLCanvasElement via ImageBuffer (note, HTMLCanvasElement is a client of ImageBuffer); this use of ImageBuffer as a layer can be removed if we introduce a reference from Canvas2DLayerBridge to HTMLCanvasElement. We can start from this.

A couple of other easily identifiable pieces are:
1. GPU memory management can be shifted to HTMLCanvasElement
2. The use of Skia encoders in ImageDataBuffer struct can be moved to third_party/WebKit/Source/platform/image-encoders/ImageEncoder.h
3. ImageBuffer is used trivially in OffscreenCanvas; it's just there for OffscreenCanvas to access to the ImageBufferSurface.
and so on...

In general, I think
1. Things that are specific to accelerated html canvas can be shifted to Canvas2DLayerBridge and HTMLCanvasElement.
2. Codes in the ImageBufferSurface and its subclasses can be moved to CanvasResourceProvider, a class that needs to be extended beyond the current use in Canvas2DLayerBridge.
Project Member

Comment 4 by bugdroid1@chromium.org, Nov 23 2017

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

commit 6c4cca504533b317b3b61e7417e4582a45f58881
Author: xlai <xlai@chromium.org>
Date: Thu Nov 23 18:06:10 2017

Tear down ImageBuffer's reference to HTMLCanvasElement via ImageBufferClient

As a first step to remove ImageBuffer(Surface), this CL refactors the
followings:
- Remove ImageBufferClient and break ImageBuffer's reference to canvas element
- Move ImageBuffer's various functions to HTMLCanvasElement, including
    UpdateGPUMemoryUsage, DisableAcceleration, gpu_readback_frame computation,
    etc.)
- Introduce abstract class CanvasResourceHost as a way for
    Canvas2DLayerBridge (and temporarily, RecordingImageBufferSurface) to point
    to HTMLCanvasElement.
- Reconcile UpdateGPUMemoryUsage() and UpdateExternallyAllocatedMemory() in one
    single function.


Bug:  776806 
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I7b3fdfad476c02b6e4368d3ef1e5eca9688cbf5b
Reviewed-on: https://chromium-review.googlesource.com/774996
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Justin Novosad <junov@chromium.org>
Commit-Queue: Olivia Lai <xlai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518980}
[modify] https://crrev.com/6c4cca504533b317b3b61e7417e4582a45f58881/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
[modify] https://crrev.com/6c4cca504533b317b3b61e7417e4582a45f58881/third_party/WebKit/Source/core/html/HTMLCanvasElement.h
[modify] https://crrev.com/6c4cca504533b317b3b61e7417e4582a45f58881/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.h
[modify] https://crrev.com/6c4cca504533b317b3b61e7417e4582a45f58881/third_party/WebKit/Source/modules/canvas/canvas2d/BaseRenderingContext2D.cpp
[modify] https://crrev.com/6c4cca504533b317b3b61e7417e4582a45f58881/third_party/WebKit/Source/modules/canvas/canvas2d/BaseRenderingContext2D.h
[modify] https://crrev.com/6c4cca504533b317b3b61e7417e4582a45f58881/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2D.cpp
[modify] https://crrev.com/6c4cca504533b317b3b61e7417e4582a45f58881/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2D.h
[modify] https://crrev.com/6c4cca504533b317b3b61e7417e4582a45f58881/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2DTest.cpp
[modify] https://crrev.com/6c4cca504533b317b3b61e7417e4582a45f58881/third_party/WebKit/Source/modules/canvas/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
[modify] https://crrev.com/6c4cca504533b317b3b61e7417e4582a45f58881/third_party/WebKit/Source/modules/canvas/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h
[modify] https://crrev.com/6c4cca504533b317b3b61e7417e4582a45f58881/third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.cpp
[modify] https://crrev.com/6c4cca504533b317b3b61e7417e4582a45f58881/third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.h
[modify] https://crrev.com/6c4cca504533b317b3b61e7417e4582a45f58881/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
[modify] https://crrev.com/6c4cca504533b317b3b61e7417e4582a45f58881/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
[modify] https://crrev.com/6c4cca504533b317b3b61e7417e4582a45f58881/third_party/WebKit/Source/platform/BUILD.gn
[modify] https://crrev.com/6c4cca504533b317b3b61e7417e4582a45f58881/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
[modify] https://crrev.com/6c4cca504533b317b3b61e7417e4582a45f58881/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.h
[modify] https://crrev.com/6c4cca504533b317b3b61e7417e4582a45f58881/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp
[add] https://crrev.com/6c4cca504533b317b3b61e7417e4582a45f58881/third_party/WebKit/Source/platform/graphics/CanvasResourceHost.h
[modify] https://crrev.com/6c4cca504533b317b3b61e7417e4582a45f58881/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp
[modify] https://crrev.com/6c4cca504533b317b3b61e7417e4582a45f58881/third_party/WebKit/Source/platform/graphics/ImageBuffer.h
[delete] https://crrev.com/4138b8862b533cba8a7d8efb5afe10f2bc90f52b/third_party/WebKit/Source/platform/graphics/ImageBufferClient.h
[modify] https://crrev.com/6c4cca504533b317b3b61e7417e4582a45f58881/third_party/WebKit/Source/platform/graphics/ImageBufferSurface.h
[modify] https://crrev.com/6c4cca504533b317b3b61e7417e4582a45f58881/third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurface.cpp
[modify] https://crrev.com/6c4cca504533b317b3b61e7417e4582a45f58881/third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurface.h
[modify] https://crrev.com/6c4cca504533b317b3b61e7417e4582a45f58881/third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurfaceTest.cpp
[modify] https://crrev.com/6c4cca504533b317b3b61e7417e4582a45f58881/third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContextTest.cpp

Comment 5 by xlai@chromium.org, Dec 1 2017

Blockedon: 776826

Comment 6 by xlai@chromium.org, Dec 1 2017

Current class diagram v.s. desired class diagram (draft)

After taking away ImageBuffer, CanvasRenderingContext (or BaseRenderingContext2D, less preferably) should have a way to access CanvasResourceProvider as there are many actions that are directly acting on the graphics resource.
Current Class Diagram.png
86.5 KB View Download
Desired Class Diagram.png
63.6 KB View Download

Comment 7 by junov@chromium.org, Dec 4 2017

Diagrams lgtm. Just one detail though I think it would be nice to have a single point of ownership for CanvasResourceProvider.  That could be CanvasRenderingContextHost.
Project Member

Comment 8 by bugdroid1@chromium.org, Dec 5 2017

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

commit 446da8a7256b32c82c88461036e01213a9041a23
Author: xlai <xlai@chromium.org>
Date: Tue Dec 05 20:50:40 2017

Detach imagebuffer references from CSSPaint

This CL removes RecordingImageBufferSurface.

Bug:  776806 
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I01e3d77702d92beef2fe73d7ecf7ad51df7ac86d
Reviewed-on: https://chromium-review.googlesource.com/809189
Commit-Queue: Olivia Lai <xlai@chromium.org>
Reviewed-by: Justin Novosad <junov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521823}
[modify] https://crrev.com/446da8a7256b32c82c88461036e01213a9041a23/third_party/WebKit/Source/modules/canvas/canvas2d/BaseRenderingContext2D.cpp
[modify] https://crrev.com/446da8a7256b32c82c88461036e01213a9041a23/third_party/WebKit/Source/modules/canvas/canvas2d/BaseRenderingContext2D.h
[modify] https://crrev.com/446da8a7256b32c82c88461036e01213a9041a23/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2D.cpp
[modify] https://crrev.com/446da8a7256b32c82c88461036e01213a9041a23/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.cpp
[modify] https://crrev.com/446da8a7256b32c82c88461036e01213a9041a23/third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.cpp
[modify] https://crrev.com/446da8a7256b32c82c88461036e01213a9041a23/third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.h
[modify] https://crrev.com/446da8a7256b32c82c88461036e01213a9041a23/third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2DTest.cpp
[modify] https://crrev.com/446da8a7256b32c82c88461036e01213a9041a23/third_party/WebKit/Source/modules/csspaint/README.md
[modify] https://crrev.com/446da8a7256b32c82c88461036e01213a9041a23/third_party/WebKit/Source/platform/BUILD.gn
[modify] https://crrev.com/446da8a7256b32c82c88461036e01213a9041a23/third_party/WebKit/Source/platform/graphics/CanvasHeuristicParameters.h
[modify] https://crrev.com/446da8a7256b32c82c88461036e01213a9041a23/third_party/WebKit/Source/platform/graphics/CanvasMetrics.h
[modify] https://crrev.com/446da8a7256b32c82c88461036e01213a9041a23/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp
[modify] https://crrev.com/446da8a7256b32c82c88461036e01213a9041a23/third_party/WebKit/Source/platform/graphics/ImageBuffer.h
[modify] https://crrev.com/446da8a7256b32c82c88461036e01213a9041a23/third_party/WebKit/Source/platform/graphics/ImageBufferSurface.h
[delete] https://crrev.com/1ed4b967488aa3018ef61b7feb477bc9a944e773/third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurface.cpp
[delete] https://crrev.com/1ed4b967488aa3018ef61b7feb477bc9a944e773/third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurface.h
[delete] https://crrev.com/1ed4b967488aa3018ef61b7feb477bc9a944e773/third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurfaceTest.cpp

Comment 9 by xlai@chromium.org, Dec 12 2017

Blockedon: 794194
Project Member

Comment 10 by bugdroid1@chromium.org, Dec 12 2017

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

commit 4de3d532c1d642557ac8886bd83c7b6dada2e130
Author: xlai <xlai@chromium.org>
Date: Tue Dec 12 19:10:46 2017

Make ImageBuffer::GetImageData to be a static function in StaticBitmapImage

As a prepartory step to remove ImageBuffer, this CL moves the GetImageData
function (which has nothing to do with ImageData) from ImageBuffer to
StaticBitmapImage. Some unnecessary checks (e.g., IsSurfaceValid() which has
been checked over and over again) in the function have been removed.

Bug:  776806 
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Iab7a346644027901bb10c96cc9c62a0e4336748d
Reviewed-on: https://chromium-review.googlesource.com/820016
Commit-Queue: Olivia Lai <xlai@chromium.org>
Reviewed-by: Justin Novosad <junov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523501}
[modify] https://crrev.com/4de3d532c1d642557ac8886bd83c7b6dada2e130/third_party/WebKit/Source/core/layout/shapes/Shape.cpp
[modify] https://crrev.com/4de3d532c1d642557ac8886bd83c7b6dada2e130/third_party/WebKit/Source/modules/canvas/canvas2d/BaseRenderingContext2D.cpp
[modify] https://crrev.com/4de3d532c1d642557ac8886bd83c7b6dada2e130/third_party/WebKit/Source/platform/BUILD.gn
[modify] https://crrev.com/4de3d532c1d642557ac8886bd83c7b6dada2e130/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp
[modify] https://crrev.com/4de3d532c1d642557ac8886bd83c7b6dada2e130/third_party/WebKit/Source/platform/graphics/ImageBuffer.h
[delete] https://crrev.com/fee6fdeaef1de2f46c34ed3143d56cc672ed69f1/third_party/WebKit/Source/platform/graphics/ImageBufferTest.cpp
[modify] https://crrev.com/4de3d532c1d642557ac8886bd83c7b6dada2e130/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp
[modify] https://crrev.com/4de3d532c1d642557ac8886bd83c7b6dada2e130/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.h
[add] https://crrev.com/4de3d532c1d642557ac8886bd83c7b6dada2e130/third_party/WebKit/Source/platform/graphics/StaticBitmapImageTest.cpp

Project Member

Comment 11 by bugdroid1@chromium.org, Dec 15 2017

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

commit 6c3982b4874886a8e83338f419ea8956319a3d78
Author: xlai <xlai@chromium.org>
Date: Fri Dec 15 23:26:06 2017

Remove ImageBuffer from HTMLCanvas and its rendering contexts

This CL lets HTMLCanvasElement directly access Canvas2DLayerBridge. As a result, the ImageBuffer
and ImageBufferSurface classes are trimmed down drastically:
1. Functions that serve to re-route calls in between canvas and its rendering contexts and
   Canvas2DLayerBridge become redundant and are all removed.
2. ImageBuffer::CopyRenderingResultsFromDrawingBuffer, which is used by webgl only, now becomes
   a function in WebGLRenderingContextBase.
3. Functions that are used by canvas 2d only, such as ImageBuffer::PutByteArray,
   ImageBuffer::WritePixels, etc, have all became functions in BaseRenderingContext2D.
4. ImageBuffer::CanCreateImageBuffer becomes SkiaUtils::IsValidImageSize.
5. ImageBuffer::CopyToPlatformTexture becomes StaticBitmapImage::CopyImageToPlatformTexture.
6. Some small functions that are called once are dissolved into other classes.

Bug:  776806 , 776802 
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I4fb6ba344ac7b23761631985e61d65906f6225ed
Reviewed-on: https://chromium-review.googlesource.com/824437
Commit-Queue: Olivia Lai <xlai@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Justin Novosad <junov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524515}
[modify] https://crrev.com/6c3982b4874886a8e83338f419ea8956319a3d78/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
[modify] https://crrev.com/6c3982b4874886a8e83338f419ea8956319a3d78/third_party/WebKit/Source/core/html/HTMLCanvasElement.h
[modify] https://crrev.com/6c3982b4874886a8e83338f419ea8956319a3d78/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContextHost.h
[modify] https://crrev.com/6c3982b4874886a8e83338f419ea8956319a3d78/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
[modify] https://crrev.com/6c3982b4874886a8e83338f419ea8956319a3d78/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h
[modify] https://crrev.com/6c3982b4874886a8e83338f419ea8956319a3d78/third_party/WebKit/Source/modules/canvas/canvas2d/BaseRenderingContext2D.cpp
[modify] https://crrev.com/6c3982b4874886a8e83338f419ea8956319a3d78/third_party/WebKit/Source/modules/canvas/canvas2d/BaseRenderingContext2D.h
[modify] https://crrev.com/6c3982b4874886a8e83338f419ea8956319a3d78/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2D.cpp
[modify] https://crrev.com/6c3982b4874886a8e83338f419ea8956319a3d78/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2D.h
[modify] https://crrev.com/6c3982b4874886a8e83338f419ea8956319a3d78/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2DTest.cpp
[modify] https://crrev.com/6c3982b4874886a8e83338f419ea8956319a3d78/third_party/WebKit/Source/modules/canvas/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
[modify] https://crrev.com/6c3982b4874886a8e83338f419ea8956319a3d78/third_party/WebKit/Source/modules/canvas/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h
[modify] https://crrev.com/6c3982b4874886a8e83338f419ea8956319a3d78/third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.h
[modify] https://crrev.com/6c3982b4874886a8e83338f419ea8956319a3d78/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
[modify] https://crrev.com/6c3982b4874886a8e83338f419ea8956319a3d78/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
[modify] https://crrev.com/6c3982b4874886a8e83338f419ea8956319a3d78/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
[modify] https://crrev.com/6c3982b4874886a8e83338f419ea8956319a3d78/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.h
[modify] https://crrev.com/6c3982b4874886a8e83338f419ea8956319a3d78/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp
[modify] https://crrev.com/6c3982b4874886a8e83338f419ea8956319a3d78/third_party/WebKit/Source/platform/graphics/ImageBuffer.h
[modify] https://crrev.com/6c3982b4874886a8e83338f419ea8956319a3d78/third_party/WebKit/Source/platform/graphics/ImageBufferSurface.cpp
[modify] https://crrev.com/6c3982b4874886a8e83338f419ea8956319a3d78/third_party/WebKit/Source/platform/graphics/ImageBufferSurface.h
[modify] https://crrev.com/6c3982b4874886a8e83338f419ea8956319a3d78/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp
[modify] https://crrev.com/6c3982b4874886a8e83338f419ea8956319a3d78/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.h
[modify] https://crrev.com/6c3982b4874886a8e83338f419ea8956319a3d78/third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.h
[modify] https://crrev.com/6c3982b4874886a8e83338f419ea8956319a3d78/third_party/WebKit/Source/platform/graphics/skia/SkiaUtils.cpp
[modify] https://crrev.com/6c3982b4874886a8e83338f419ea8956319a3d78/third_party/WebKit/Source/platform/graphics/skia/SkiaUtils.h

Project Member

Comment 12 by bugdroid1@chromium.org, Jan 8 2018

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

commit 9f46559643bba3f4b003ce1f19d9f272afe2d577
Author: xlai <xlai@chromium.org>
Date: Mon Jan 08 17:48:51 2018

Delete usage of ImageBuffer in non-canvas use cases

Replace ImageBuffer with CanvasResourceProvider.

TBR=zmo@chromium.org

Bug:  776806 
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I921e929c346f7dd55a7cbcc43f03da826f118c45
Reviewed-on: https://chromium-review.googlesource.com/853015
Commit-Queue: Olivia Lai <xlai@chromium.org>
Reviewed-by: Justin Novosad <junov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#527667}
[modify] https://crrev.com/9f46559643bba3f4b003ce1f19d9f272afe2d577/third_party/WebKit/Source/core/html/media/HTMLVideoElement.cpp
[modify] https://crrev.com/9f46559643bba3f4b003ce1f19d9f272afe2d577/third_party/WebKit/Source/core/imagebitmap/ImageBitmap.cpp
[modify] https://crrev.com/9f46559643bba3f4b003ce1f19d9f272afe2d577/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
[modify] https://crrev.com/9f46559643bba3f4b003ce1f19d9f272afe2d577/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
[modify] https://crrev.com/9f46559643bba3f4b003ce1f19d9f272afe2d577/third_party/WebKit/Source/platform/DragImage.cpp
[modify] https://crrev.com/9f46559643bba3f4b003ce1f19d9f272afe2d577/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
[modify] https://crrev.com/9f46559643bba3f4b003ce1f19d9f272afe2d577/third_party/WebKit/Source/platform/graphics/CanvasResourceProvider.cpp
[modify] https://crrev.com/9f46559643bba3f4b003ce1f19d9f272afe2d577/third_party/WebKit/Source/platform/graphics/CanvasResourceProvider.h
[modify] https://crrev.com/9f46559643bba3f4b003ce1f19d9f272afe2d577/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp
[modify] https://crrev.com/9f46559643bba3f4b003ce1f19d9f272afe2d577/third_party/WebKit/Source/platform/graphics/ImageBuffer.h

Project Member

Comment 13 by bugdroid1@chromium.org, Jan 9 2018

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

commit 95fadc78e3995e16f8f5d11707b05bf27abcff57
Author: xlai <xlai@chromium.org>
Date: Tue Jan 09 21:17:37 2018

Replace ImageBuffer with CanvasResourceProvider in OffscreenCanvas

This CL removes use of ImageBuffer in OffscreenCanvas by replacing
UnacceleratedImageBufferSurface and AcceleratedImageBufferSurface with
CanvasResourceProvider with different usage setting; certain functions (e.g.,
Clear(), Canvas()->save(), WritePixels()) are shifted to CanvasResourceProvider
from ImageBufferSurface.

This CL removes UnacceleratedImageBufferSurface completely.


Bug:  776806 , 794194 
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Iadaa1060a74511c61339b7fbfc9b5c6acbfcc4a7
Reviewed-on: https://chromium-review.googlesource.com/855040
Reviewed-by: Justin Novosad <junov@chromium.org>
Commit-Queue: Olivia Lai <xlai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528114}
[modify] https://crrev.com/95fadc78e3995e16f8f5d11707b05bf27abcff57/third_party/WebKit/Source/core/html/canvas/CanvasFontCacheTest.cpp
[modify] https://crrev.com/95fadc78e3995e16f8f5d11707b05bf27abcff57/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
[modify] https://crrev.com/95fadc78e3995e16f8f5d11707b05bf27abcff57/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h
[modify] https://crrev.com/95fadc78e3995e16f8f5d11707b05bf27abcff57/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2DAPITest.cpp
[modify] https://crrev.com/95fadc78e3995e16f8f5d11707b05bf27abcff57/third_party/WebKit/Source/modules/canvas/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
[modify] https://crrev.com/95fadc78e3995e16f8f5d11707b05bf27abcff57/third_party/WebKit/Source/modules/canvas/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h
[modify] https://crrev.com/95fadc78e3995e16f8f5d11707b05bf27abcff57/third_party/WebKit/Source/platform/BUILD.gn
[modify] https://crrev.com/95fadc78e3995e16f8f5d11707b05bf27abcff57/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp
[modify] https://crrev.com/95fadc78e3995e16f8f5d11707b05bf27abcff57/third_party/WebKit/Source/platform/graphics/CanvasResourceProvider.cpp
[modify] https://crrev.com/95fadc78e3995e16f8f5d11707b05bf27abcff57/third_party/WebKit/Source/platform/graphics/CanvasResourceProvider.h
[modify] https://crrev.com/95fadc78e3995e16f8f5d11707b05bf27abcff57/third_party/WebKit/Source/platform/graphics/GraphicsTypes.h
[modify] https://crrev.com/95fadc78e3995e16f8f5d11707b05bf27abcff57/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp
[delete] https://crrev.com/05fc942cc97bad9f1f3a01cb139be1243ef6cd8b/third_party/WebKit/Source/platform/graphics/UnacceleratedImageBufferSurface.cpp
[delete] https://crrev.com/05fc942cc97bad9f1f3a01cb139be1243ef6cd8b/third_party/WebKit/Source/platform/graphics/UnacceleratedImageBufferSurface.h
[modify] https://crrev.com/95fadc78e3995e16f8f5d11707b05bf27abcff57/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTest.cpp

Project Member

Comment 14 by bugdroid1@chromium.org, Jan 15 2018

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

commit d02bb8346f13117d4a81d1124a3aeeaaed83ae99
Author: xlai <xlai@chromium.org>
Date: Mon Jan 15 20:58:51 2018

Replace webgl_buffer_ in canvas and Remove ImageBuffer(Surface) etc

This CL removes HTMLCanvasElement's webgl_buffer_ and replaces it with
resource_provider_. We still let Canvas2DLayerBridge own the resource provider
pointer when canvas is having 2d rendering context, as Canvas2DLayerBridge
needs to interact with the resource provider pointer intensively.

As AcceleratedImageBufferSurface is replaced with ResourceProvider in all
places, we then remove it together with ImageBufferSurface and ImageBuffer
classes. The ImageBuffer.h is renamed to ImageDataBuffer.h as there is still
another class in that file.

TBR=aboxhall@chromium.org,zmo@chromium.org

Bug:  776806 , 794194 
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I2ac9d0d17265f6e482c5a0a787ef0e9b77c004ab
Reviewed-on: https://chromium-review.googlesource.com/864630
Commit-Queue: Olivia Lai <xlai@chromium.org>
Reviewed-by: Justin Novosad <junov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#529328}
[modify] https://crrev.com/d02bb8346f13117d4a81d1124a3aeeaaed83ae99/third_party/WebKit/Source/core/exported/WebViewImpl.cpp
[modify] https://crrev.com/d02bb8346f13117d4a81d1124a3aeeaaed83ae99/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
[modify] https://crrev.com/d02bb8346f13117d4a81d1124a3aeeaaed83ae99/third_party/WebKit/Source/core/html/HTMLCanvasElement.h
[modify] https://crrev.com/d02bb8346f13117d4a81d1124a3aeeaaed83ae99/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.cpp
[modify] https://crrev.com/d02bb8346f13117d4a81d1124a3aeeaaed83ae99/third_party/WebKit/Source/core/imagebitmap/ImageBitmap.h
[modify] https://crrev.com/d02bb8346f13117d4a81d1124a3aeeaaed83ae99/third_party/WebKit/Source/core/inspector/InspectorAuditsAgent.cpp
[modify] https://crrev.com/d02bb8346f13117d4a81d1124a3aeeaaed83ae99/third_party/WebKit/Source/core/paint/HTMLCanvasPainterTest.cpp
[modify] https://crrev.com/d02bb8346f13117d4a81d1124a3aeeaaed83ae99/third_party/WebKit/Source/core/paint/ThemePainterMac.mm
[modify] https://crrev.com/d02bb8346f13117d4a81d1124a3aeeaaed83ae99/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
[modify] https://crrev.com/d02bb8346f13117d4a81d1124a3aeeaaed83ae99/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
[modify] https://crrev.com/d02bb8346f13117d4a81d1124a3aeeaaed83ae99/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2DTest.cpp
[modify] https://crrev.com/d02bb8346f13117d4a81d1124a3aeeaaed83ae99/third_party/WebKit/Source/modules/canvas/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
[modify] https://crrev.com/d02bb8346f13117d4a81d1124a3aeeaaed83ae99/third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2DTest.cpp
[modify] https://crrev.com/d02bb8346f13117d4a81d1124a3aeeaaed83ae99/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.h
[modify] https://crrev.com/d02bb8346f13117d4a81d1124a3aeeaaed83ae99/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
[modify] https://crrev.com/d02bb8346f13117d4a81d1124a3aeeaaed83ae99/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
[modify] https://crrev.com/d02bb8346f13117d4a81d1124a3aeeaaed83ae99/third_party/WebKit/Source/platform/BUILD.gn
[modify] https://crrev.com/d02bb8346f13117d4a81d1124a3aeeaaed83ae99/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
[modify] https://crrev.com/d02bb8346f13117d4a81d1124a3aeeaaed83ae99/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.h
[modify] https://crrev.com/d02bb8346f13117d4a81d1124a3aeeaaed83ae99/third_party/WebKit/Source/platform/graphics/CanvasResourceProvider.cpp
[modify] https://crrev.com/d02bb8346f13117d4a81d1124a3aeeaaed83ae99/third_party/WebKit/Source/platform/graphics/CanvasResourceProvider.h
[modify] https://crrev.com/d02bb8346f13117d4a81d1124a3aeeaaed83ae99/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp
[delete] https://crrev.com/ddbc1a049317170cd1e2477e0dd002ba5b6f00cb/third_party/WebKit/Source/platform/graphics/ImageBufferSurface.cpp
[delete] https://crrev.com/ddbc1a049317170cd1e2477e0dd002ba5b6f00cb/third_party/WebKit/Source/platform/graphics/ImageBufferSurface.h
[rename] https://crrev.com/d02bb8346f13117d4a81d1124a3aeeaaed83ae99/third_party/WebKit/Source/platform/graphics/ImageDataBuffer.cpp
[rename] https://crrev.com/d02bb8346f13117d4a81d1124a3aeeaaed83ae99/third_party/WebKit/Source/platform/graphics/ImageDataBuffer.h
[modify] https://crrev.com/d02bb8346f13117d4a81d1124a3aeeaaed83ae99/third_party/WebKit/Source/platform/graphics/LoggingCanvas.cpp
[modify] https://crrev.com/d02bb8346f13117d4a81d1124a3aeeaaed83ae99/third_party/WebKit/Source/platform/graphics/PictureSnapshot.cpp
[delete] https://crrev.com/ddbc1a049317170cd1e2477e0dd002ba5b6f00cb/third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp
[delete] https://crrev.com/ddbc1a049317170cd1e2477e0dd002ba5b6f00cb/third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.h
[modify] https://crrev.com/d02bb8346f13117d4a81d1124a3aeeaaed83ae99/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
[modify] https://crrev.com/d02bb8346f13117d4a81d1124a3aeeaaed83ae99/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTest.cpp
[modify] https://crrev.com/d02bb8346f13117d4a81d1124a3aeeaaed83ae99/third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContextTest.cpp

Comment 15 by kbr@chromium.org, Jan 25 2018

Blockedon: 806066
Project Member

Comment 16 by bugdroid1@chromium.org, Mar 19 2018

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

commit 7efe41bf9b0cf217759e48320b6e9b9b076249d2
Author: xlai <xlai@chromium.org>
Date: Mon Mar 19 22:38:25 2018

Tidy up canvas code after ImageBuffer is removed

This CL cleans up code in canvas/OffscreenCanvas and their rendering contexts
in a world after ImageBuffer has been removed. It does the following:

- Renamed certain functions/variables to avoid misleading future readers.
- Split CreateImageBuffer into two functions, one for creating
  Canvas2dLayerBridge in 2d context, another for creating resourceProvider for
  webgl in webgl context. It was unnecessary and misleading to lump these two
  unrelated operations together.
- Drive-by deletion of some unused code.


TBR=zmo@chromium.org

Bug:  776806 
Cq-Include-Trybots: luci.chromium.try:linux_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: Id06026649894ddf20677f509296d87c5cfb4a5d6
Reviewed-on: https://chromium-review.googlesource.com/967252
Commit-Queue: Olivia Lai <xlai@chromium.org>
Reviewed-by: Justin Novosad <junov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544190}
[modify] https://crrev.com/7efe41bf9b0cf217759e48320b6e9b9b076249d2/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.h
[modify] https://crrev.com/7efe41bf9b0cf217759e48320b6e9b9b076249d2/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContextHost.h
[modify] https://crrev.com/7efe41bf9b0cf217759e48320b6e9b9b076249d2/third_party/WebKit/Source/core/html/canvas/HTMLCanvasElement.cpp
[modify] https://crrev.com/7efe41bf9b0cf217759e48320b6e9b9b076249d2/third_party/WebKit/Source/core/html/canvas/HTMLCanvasElement.h
[modify] https://crrev.com/7efe41bf9b0cf217759e48320b6e9b9b076249d2/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
[modify] https://crrev.com/7efe41bf9b0cf217759e48320b6e9b9b076249d2/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h
[modify] https://crrev.com/7efe41bf9b0cf217759e48320b6e9b9b076249d2/third_party/WebKit/Source/core/paint/HTMLCanvasPainterTest.cpp
[modify] https://crrev.com/7efe41bf9b0cf217759e48320b6e9b9b076249d2/third_party/WebKit/Source/modules/canvas/canvas2d/BaseRenderingContext2D.cpp
[modify] https://crrev.com/7efe41bf9b0cf217759e48320b6e9b9b076249d2/third_party/WebKit/Source/modules/canvas/canvas2d/BaseRenderingContext2D.h
[modify] https://crrev.com/7efe41bf9b0cf217759e48320b6e9b9b076249d2/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2D.cpp
[modify] https://crrev.com/7efe41bf9b0cf217759e48320b6e9b9b076249d2/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2D.h
[modify] https://crrev.com/7efe41bf9b0cf217759e48320b6e9b9b076249d2/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2DTest.cpp
[modify] https://crrev.com/7efe41bf9b0cf217759e48320b6e9b9b076249d2/third_party/WebKit/Source/modules/canvas/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
[modify] https://crrev.com/7efe41bf9b0cf217759e48320b6e9b9b076249d2/third_party/WebKit/Source/modules/canvas/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h
[modify] https://crrev.com/7efe41bf9b0cf217759e48320b6e9b9b076249d2/third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.h
[modify] https://crrev.com/7efe41bf9b0cf217759e48320b6e9b9b076249d2/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp

Comment 17 by xlai@chromium.org, Mar 20 2018

Status: Fixed (was: Started)

Sign in to add a comment