WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
226384
Make ImageBuffer be able to put pixels directly into its backend from another ImageBuffer
https://bugs.webkit.org/show_bug.cgi?id=226384
Summary
Make ImageBuffer be able to put pixels directly into its backend from another...
Said Abou-Hallawa
Reported
2021-05-28 11:36:02 PDT
This can replace the call to ImageBuffer::draw() where alpha blending or scaling is required, for example the call in SourceGraphic::platformApplySoftware().
Attachments
Patch
(3.86 KB, patch)
2021-05-28 11:38 PDT
,
Said Abou-Hallawa
no flags
Details
Formatted Diff
Diff
Patch
(19.34 KB, patch)
2021-05-28 13:32 PDT
,
Said Abou-Hallawa
no flags
Details
Formatted Diff
Diff
Patch
(19.34 KB, patch)
2021-05-28 15:53 PDT
,
Said Abou-Hallawa
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(19.34 KB, patch)
2021-05-28 16:04 PDT
,
Said Abou-Hallawa
no flags
Details
Formatted Diff
Diff
Patch
(56.73 KB, patch)
2021-05-29 14:06 PDT
,
Said Abou-Hallawa
no flags
Details
Formatted Diff
Diff
Patch
(61.81 KB, patch)
2021-05-29 14:24 PDT
,
Said Abou-Hallawa
no flags
Details
Formatted Diff
Diff
Patch
(35.43 KB, patch)
2021-05-31 04:43 PDT
,
Said Abou-Hallawa
no flags
Details
Formatted Diff
Diff
Patch
(35.55 KB, patch)
2021-05-31 05:33 PDT
,
Said Abou-Hallawa
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(35.58 KB, patch)
2021-05-31 05:46 PDT
,
Said Abou-Hallawa
sabouhallawa
: review?
Details
Formatted Diff
Diff
Show Obsolete
(8)
View All
Add attachment
proposed patch, testcase, etc.
Said Abou-Hallawa
Comment 1
2021-05-28 11:37:26 PDT
I meant: ...where alpha blending or scaling is NOT required.
Said Abou-Hallawa
Comment 2
2021-05-28 11:38:24 PDT
Created
attachment 430032
[details]
Patch
Simon Fraser (smfr)
Comment 3
2021-05-28 11:39:40 PDT
Comment on
attachment 430032
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=430032&action=review
> Source/WebCore/platform/graphics/ImageBuffer.cpp:195 > + if (auto pixelBuffer = sourceImage.getPixelBuffer(format, srcRect))
For buffers with GPU backing (IOSurfaces) does this trigger readback?
Simon Fraser (smfr)
Comment 4
2021-05-28 11:41:40 PDT
Comment on
attachment 430032
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=430032&action=review
> Source/WebCore/platform/graphics/ImageBuffer.cpp:187 > + if (resolutionScale() != sourceImage.resolutionScale()) {
Doesn't this also need to check color profiles and maybe more?
Said Abou-Hallawa
Comment 5
2021-05-28 11:44:23 PDT
Comment on
attachment 430032
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=430032&action=review
>> Source/WebCore/platform/graphics/ImageBuffer.cpp:195 >> + if (auto pixelBuffer = sourceImage.getPixelBuffer(format, srcRect)) > > For buffers with GPU backing (IOSurfaces) does this trigger readback?
Oh yes. I was thinking about filters in WebProcess. For GPUP case, I think we need to create a DL item which can only be used if both source and destination are in GPUP.
Said Abou-Hallawa
Comment 6
2021-05-28 11:49:50 PDT
This code can be optimized more if we copy from the source backend to the destination backend directly without going through the PixelBuffer.
Said Abou-Hallawa
Comment 7
2021-05-28 12:45:53 PDT
Comment on
attachment 430032
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=430032&action=review
>> Source/WebCore/platform/graphics/ImageBuffer.cpp:187 >> + if (resolutionScale() != sourceImage.resolutionScale()) { > > Doesn't this also need to check color profiles and maybe more?
I think getPixelBuffer() will take care of these. The source PixelBufferFormat below is set to get the pixels in the destination colorSpace() and pixelFormat().
Said Abou-Hallawa
Comment 8
2021-05-28 13:32:59 PDT
Created
attachment 430046
[details]
Patch
Said Abou-Hallawa
Comment 9
2021-05-28 15:53:26 PDT
Created
attachment 430065
[details]
Patch
Said Abou-Hallawa
Comment 10
2021-05-28 16:04:39 PDT
Created
attachment 430066
[details]
Patch
Sam Weinig
Comment 11
2021-05-29 09:09:35 PDT
Comment on
attachment 430066
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=430066&action=review
> Source/WebCore/platform/graphics/displaylists/DisplayListItems.h:2088 > + PutImageBuffer(RenderingResourceIdentifier imageBufferIdentifier, const IntPoint& destPoint)
Does anything need to be done to ensure the sourceImage is not mutated before this can happen?
Said Abou-Hallawa
Comment 12
2021-05-29 14:06:51 PDT
Created
attachment 430110
[details]
Patch
Said Abou-Hallawa
Comment 13
2021-05-29 14:11:13 PDT
Comment on
attachment 430066
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=430066&action=review
>> Source/WebCore/platform/graphics/displaylists/DisplayListItems.h:2088 >> + PutImageBuffer(RenderingResourceIdentifier imageBufferIdentifier, const IntPoint& destPoint) > > Does anything need to be done to ensure the sourceImage is not mutated before this can happen?
Yes you are right. PutImageBuffer should be a synchronous message after making sure all the pending items in both source and destination ImageBuffers are flushed to their backends.
Said Abou-Hallawa
Comment 14
2021-05-29 14:24:00 PDT
Created
attachment 430111
[details]
Patch
Said Abou-Hallawa
Comment 15
2021-05-31 04:43:41 PDT
Created
attachment 430196
[details]
Patch
Said Abou-Hallawa
Comment 16
2021-05-31 05:33:58 PDT
Created
attachment 430198
[details]
Patch
Said Abou-Hallawa
Comment 17
2021-05-31 05:46:42 PDT
Created
attachment 430199
[details]
Patch
Radar WebKit Bug Importer
Comment 18
2021-06-04 11:37:53 PDT
<
rdar://problem/78878491
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug