Bug 247033

Summary: Fix divide by zero warning in TextureMapperLayer
Product: WebKit Reporter: Don Olmstead <don.olmstead>
Component: PlatformAssignee: Don Olmstead <don.olmstead>
Status: RESOLVED FIXED    
Severity: Normal CC: annulen, ews-watchlist, gyuyoung.kim, Hironori.Fujii, ryuan.choi, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
[fast-cq] Patch
none
[fast-cq] Patch none

Description Don Olmstead 2022-10-25 16:14:59 PDT
....
Comment 1 Don Olmstead 2022-10-25 16:20:50 PDT
Pull request: https://github.com/WebKit/WebKit/pull/5787
Comment 2 Fujii Hironori 2022-10-25 17:16:51 PDT
WinCairo Release build is reporting the following warnings.

> WebCore\platform\graphics\texmap\TextureMapperLayer.cpp(471) : warning C4723: potential divide by 0
> WebCore\platform\graphics\texmap\TextureMapperLayer.cpp(443) : warning C4723: potential divide by 0
> WebCore\platform\graphics\texmap\TextureMapperLayer.cpp(470) : warning C4723: potential divide by 0
> WebCore\platform\graphics\texmap\TextureMapperLayer.cpp(478) : warning C4723: potential divide by 0
> WebCore\platform\graphics\texmap\TextureMapperLayer.cpp(443) : warning C4723: potential divide by 0
> WebCore\platform\graphics\texmap\TextureMapperLayer.cpp(475) : warning C4723: potential divide by 0
> WebCore\platform\graphics\texmap\TextureMapperLayer.cpp(443) : warning C4723: potential divide by 0
> WebCore\platform\graphics\texmap\TextureMapperLayer.cpp(475) : warning C4723: potential divide by 0
> WebCore\platform\graphics\texmap\TextureMapperLayer.cpp(471) : warning C4723: potential divide by 0
> WebCore\platform\graphics\texmap\TextureMapperLayer.cpp(443) : warning C4723: potential divide by 0
> WebCore\platform\graphics\texmap\TextureMapperLayer.cpp(470) : warning C4723: potential divide by 0
> WebCore\platform\graphics\texmap\TextureMapperLayer.cpp(478) : warning C4723: potential divide by 0
> WebCore\platform\graphics\texmap\TextureMapperLayer.cpp(471) : warning C4723: potential divide by 0
> WebCore\platform\graphics\texmap\TextureMapperLayer.cpp(443) : warning C4723: potential divide by 0
> WebCore\platform\graphics\texmap\TextureMapperLayer.cpp(470) : warning C4723: potential divide by 0
> WebCore\platform\graphics\texmap\TextureMapperLayer.cpp(478) : warning C4723: potential divide by 0

I'm using 0 division intentionally here to get positive/negative
inifity to represent a pont at inifity. But, I should admit it's
a bad practice. I have a plan to re-write the code to precisely
calculate the bounding box of transformed layer by 4x4 matix.

I think we should align MSVC compiler warning as much as GC and Clang .
Comment 3 Fujii Hironori 2022-10-25 17:34:14 PDT
Created attachment 463244 [details]
[fast-cq] Patch
Comment 4 Fujii Hironori 2022-10-25 18:30:07 PDT
(In reply to Fujii Hironori from comment #2)
> I have a plan to re-write the code to precisely calculate the bounding box of transformed layer by 4x4 matix.

Filed: Bug 247042 – TextureMapper: Calculate the bounding box of a layer transformed by 4x4 matrix precisely by intersecting with the viewport
Comment 5 Fujii Hironori 2022-10-25 18:55:27 PDT
Created attachment 463246 [details]
[fast-cq] Patch
Comment 6 EWS 2022-10-25 18:58:43 PDT
Committed 255997@main (214a966eafad): <https://commits.webkit.org/255997@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 463246 [details].
Comment 7 Radar WebKit Bug Importer 2022-10-25 18:59:16 PDT
<rdar://problem/101571279>