WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
215015
[CG] Avoid creating a sub-image when drawing a small scaled sub-rect from a native image
https://bugs.webkit.org/show_bug.cgi?id=215015
Summary
[CG] Avoid creating a sub-image when drawing a small scaled sub-rect from a n...
Said Abou-Hallawa
Reported
2020-07-31 02:18:55 PDT
The reason for creating the sub-image in GraphicsContext::drawNativeImage() is to have a better image interpolation for the scaled sub-rect. For small destRect, the interpolation on the original image is almost the same as the interpolation on the sub-image. So we should avoid creating the sub-image if destRect.area() is less than some minimum value. This will benefit the case of drawing many small rectangles from a large sprite image.
Attachments
Patch
(2.48 KB, patch)
2020-07-31 02:28 PDT
,
Said Abou-Hallawa
no flags
Details
Formatted Diff
Diff
Patch
(10.48 KB, patch)
2020-08-03 01:10 PDT
,
Said Abou-Hallawa
no flags
Details
Formatted Diff
Diff
Patch
(10.77 KB, patch)
2020-08-03 12:06 PDT
,
Said Abou-Hallawa
no flags
Details
Formatted Diff
Diff
Patch
(2.69 KB, patch)
2020-08-06 12:15 PDT
,
Said Abou-Hallawa
no flags
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Said Abou-Hallawa
Comment 1
2020-07-31 02:19:47 PDT
<
rdar://problem/63845893
>
Said Abou-Hallawa
Comment 2
2020-07-31 02:28:38 PDT
Created
attachment 405677
[details]
Patch
Simon Fraser (smfr)
Comment 3
2020-07-31 08:58:35 PDT
Does the subimage cache come into play here? Does turning it off change behavior?
Said Abou-Hallawa
Comment 4
2020-08-03 01:10:05 PDT
Created
attachment 405817
[details]
Patch
Said Abou-Hallawa
Comment 5
2020-08-03 12:06:35 PDT
Created
attachment 405853
[details]
Patch
Said Abou-Hallawa
Comment 6
2020-08-03 12:19:25 PDT
(In reply to Simon Fraser (smfr) from
comment #3
)
> Does the subimage cache come into play here? Does turning it off change > behavior?
No not really. Subimage cache requires creating the sub images also. So the cost of caching these images is added when the sub-image is rendered for the first time. For example, a page creates a picker element when it is first needed. When the picker element is popped up, its layer is rendered and the children elements are rendered for the first time. At this time the rendering might be slow if many sub-images are created. When the user selects an element from the picker or dismisses it, the picker element is hidden. If the user invokes an action which pops the picker up again, no rendering will be needed. All we need is showing the picker's layer. So caching and non caching the sub-images will not affect the rendering speed after the first time the sub-images are rendered.
Said Abou-Hallawa
Comment 7
2020-08-06 12:15:50 PDT
Created
attachment 406099
[details]
Patch
EWS
Comment 8
2020-08-06 14:02:18 PDT
Committed
r265346
: <
https://trac.webkit.org/changeset/265346
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 406099
[details]
.
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