RESOLVED FIXED Bug 235305
[GPU Process] ImageBuffer::convertToLuminanceMask() and transformToColorSpace() should not access the backend in WebProcess
https://bugs.webkit.org/show_bug.cgi?id=235305
Summary [GPU Process] ImageBuffer::convertToLuminanceMask() and transformToColorSpace...
Said Abou-Hallawa
Reported 2022-01-17 16:41:12 PST
When DOM rendering is handled in GPU Process, no backend access will be allowed. So all the operations that require access to the backend should be handled in GPU Process. The WebProcess will stream messages for these operations to GPUProcess.
Attachments
Patch (10.59 KB, patch)
2022-01-17 16:44 PST, Said Abou-Hallawa
no flags
Patch (10.60 KB, patch)
2022-01-17 17:15 PST, Said Abou-Hallawa
no flags
Said Abou-Hallawa
Comment 1 2022-01-17 16:41:38 PST
Said Abou-Hallawa
Comment 2 2022-01-17 16:44:59 PST
Sam Weinig
Comment 3 2022-01-17 16:57:16 PST
Comment on attachment 449354 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=449354&action=review > Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h:64 > + virtual void transformToColorSpace(const DestinationColorSpace&) = 0; Is transformToColorSpace to ever used? It doesn't make a lot (any?) sense in the way ImageBuffer works since it ImageBuffers have color spaces already. > Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h:265 > + m_remoteDisplayList.convertToLuminanceMask(); Why does this call convertToLuminanceMask() as well?
Said Abou-Hallawa
Comment 4 2022-01-17 17:15:06 PST
Comment on attachment 449354 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=449354&action=review >> Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h:64 >> + virtual void transformToColorSpace(const DestinationColorSpace&) = 0; > > Is transformToColorSpace to ever used? It doesn't make a lot (any?) sense in the way ImageBuffer works since it ImageBuffers have color spaces already. transformToColorSpace() is implemented for the Cairo port in ImageBufferCairoBackend::transformToColorSpace(). The call to this function in WebCore is not guarded by #if USE(CAIRO). For other ports, we fall back to the default implementation in ImageBufferBackend which is just an empty function. >> Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h:265 >> + m_remoteDisplayList.convertToLuminanceMask(); > > Why does this call convertToLuminanceMask() as well? Copy/Paste mistake. Fixed.
Said Abou-Hallawa
Comment 5 2022-01-17 17:15:22 PST
Sam Weinig
Comment 6 2022-01-18 11:30:05 PST
(In reply to Said Abou-Hallawa from comment #4) > Comment on attachment 449354 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=449354&action=review > > >> Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h:64 > >> + virtual void transformToColorSpace(const DestinationColorSpace&) = 0; > > > > Is transformToColorSpace to ever used? It doesn't make a lot (any?) sense in the way ImageBuffer works since it ImageBuffers have color spaces already. > > transformToColorSpace() is implemented for the Cairo port in > ImageBufferCairoBackend::transformToColorSpace(). The call to this function > in WebCore is not guarded by #if USE(CAIRO). For other ports, we fall back > to the default implementation in ImageBufferBackend which is just an empty > function. Ah. Seems like we should figure out what they are trying to accomplish with it and remove it since it makes no sense. Probably makes more sense to create a new ImageBuffer from an existing one with some per-pixel transform or just implement it for them in terms of getPixelData/setPixelData. > > >> Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h:265 > >> + m_remoteDisplayList.convertToLuminanceMask(); > > > > Why does this call convertToLuminanceMask() as well? > > Copy/Paste mistake. Fixed.
Sam Weinig
Comment 7 2022-01-18 11:35:22 PST
(In reply to Sam Weinig from comment #6) > (In reply to Said Abou-Hallawa from comment #4) > > Comment on attachment 449354 [details] > > Patch > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=449354&action=review > > > > >> Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h:64 > > >> + virtual void transformToColorSpace(const DestinationColorSpace&) = 0; > > > > > > Is transformToColorSpace to ever used? It doesn't make a lot (any?) sense in the way ImageBuffer works since it ImageBuffers have color spaces already. > > > > transformToColorSpace() is implemented for the Cairo port in > > ImageBufferCairoBackend::transformToColorSpace(). The call to this function > > in WebCore is not guarded by #if USE(CAIRO). For other ports, we fall back > > to the default implementation in ImageBufferBackend which is just an empty > > function. > > Ah. Seems like we should figure out what they are trying to accomplish with > it and remove it since it makes no sense. Probably makes more sense to > create a new ImageBuffer from an existing one with some per-pixel transform > or just implement it for them in terms of getPixelData/setPixelData. And by makes no sense I mean, doesn't match the semantics of ImageBuffer (though if they are depending on drawing into an sRGB image buffer and then converting all the pixels to linear-sRGB being the same as drawing into a linear-sRGB buffer I don't think they will be as the blending will be different.)
EWS
Comment 8 2022-01-19 13:39:35 PST
Committed r288240 (246194@main): <https://commits.webkit.org/246194@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 449357 [details].
Note You need to log in before you can comment on or make changes to this bug.