-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Use smart pointers in GraphicsContextGLCVCocoa #47237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Use smart pointers in GraphicsContextGLCVCocoa #47237
Conversation
EWS run on previous version of this PR (hash 0cf5ddd) |
0cf5ddd
to
c97305d
Compare
EWS run on previous version of this PR (hash c97305d) |
Safer C++ Build #41807 (c97305d)
|
https://bugs.webkit.org/show_bug.cgi?id=295027 Reviewed by NOBODY (OOPS!). Fix remaining warnings of type [alpha.webkit.UnretainedCallArgsChecker]. * Source/WebCore/platform/graphics/cv/GraphicsContextGLCVCocoa.mm: (WebCore::transferFunctionFromString): (WebCore::GraphicsContextGLCVCocoa::copyVideoSampleToTexture):
c97305d
to
fe7a6cf
Compare
EWS run on current version of this PR (hash fe7a6cf) |
@rniwa the changes involving for example kCVImageBufferYCbCrMatrix_ITU_R_709_2 are a bit optional I think, in that likely CFEqual is a trivial function and no smart pointer should be needed. So I mainly include it to be able to remove the entry out of UnretainedCallArgsCheckerExpectations, but if we can do suppression or make the safer-cpp tooling more clever, I am happy to go with a different solution (I am guessing this will come up more since CFEqual is being used a lot). |
@@ -182,17 +182,17 @@ static TransferFunctionCV transferFunctionFromString(CFStringRef string) | |||
{ | |||
if (!string) | |||
return TransferFunctionCV::Unknown; | |||
if (CFEqual(string, kCVImageBufferYCbCrMatrix_ITU_R_709_2)) | |||
if (RetainPtr matrix = kCVImageBufferYCbCrMatrix_ITU_R_709_2; CFEqual(string, matrix.get())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should just fix the static analyzer to treat CFEqual as a trivial function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made an attempt at llvm/llvm-project#146369. Not sure if you are a reviewer. Also feel free to take over if it is way off. The most important thing is to get it fixed, and then I can rebase this PR and it would be a one-liner PR..
fe7a6cf
fe7a6cf