-
Notifications
You must be signed in to change notification settings - Fork 187
[win32] Dynamic handle creation for transform #1864
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
[win32] Dynamic handle creation for transform #1864
Conversation
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Transform.java
Outdated
Show resolved
Hide resolved
9414c03 to
2ad8c82
Compare
fbd40ef to
84ccb02
Compare
|
@HeikoKlare I needed to adapt the MultiplyOperation, because the passed matrix could already be disposed when executed. see the new test -> I am surprised there was no Test class for Transform available yet. |
cf4300e to
d2696f3
Compare
| temporaryHandle.destroy(); | ||
| } | ||
| } else { | ||
| return function.apply(zoomToHandle.values().iterator().next()); |
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.
Isn't it risky to apply an operation on any one of the existing handles? Even tho its being used for get operations like isIdentity, it can be misused to modify one of the handles and that operation will not be registered with any other handle in that case.
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.
Anyway, I think the name is a bit misleading. It sounds like we are applying some operation (as in to modify) on the handle. A better suggestion could be "applyUsingAnyHandle"
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.
Isn't it risky to apply an operation on any one of the existing handles? Even tho its being used for get operations like isIdentity, it can be misused to modify one of the handles and that operation will not be registered with any other handle in that case.
Not in these cases. If that method would anything else then private, I would agree, but applying it on existing handles was done before in all cases. Just the "create a temporary handle if none is available"-case was added
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.
Anyway, I think the name is a bit misleading. It sounds like we are applying some operation (as in to modify) on the handle. A better suggestion could be "applyUsingAnyHandle"
Makes sense to me. I will rename it
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 think its wise to adapt the same for all the resources then.
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Transform.java
Outdated
Show resolved
Hide resolved
This commit adapts Transform in the win32 implementation to create handles only on demand. If a non-handle specific operation like isIdentity() is called, a temporary handle will be created and disposed afterwards if no handle exists already.
d2696f3 to
d1cdbe4
Compare
|
Rebased on master after #1858 was merged and addressed the comment from @amartya4256 |
This adapts Transform in the win32 implementation to create handles only on demand. If a non-handle specific operation like isIdentity() is called, a temporary handle will be created and disposed afterwards if no handle exists already.
It contains the branch used for #1858 and is a second refactoring on transform, there it must be merged after #1858