隔离连续蜘蛛盘手势并修正回归测试变量

这个提交包含在:
mac 于 2026-11-09 11:27:40 +08:00 提交
1 父节点 178e1e7d16
当前提交 6ef38faa19
2 个文件已更改
+17 -14

没有与搜索条件相匹配的文件

+3 -3
查看文件
@@ -355,9 +355,9 @@ extern "C" int DYRunDiagnostics(void) { @autoreleasepool {
[disc mouseDown:mouseFor(disc,NSEventTypeLeftMouseDown,burstStart)];
NSPoint nextPoint=NSMakePoint(burstStart.x+9,burstStart.y+3);
[disc mouseDragged:mouseFor(disc,NSEventTypeLeftMouseDragged,nextPoint)];
NSDate *deadline=[NSDate dateWithTimeIntervalSinceNow:.2];
while(uiHost->_assetWrites==writesBeforeBurst+1&&[deadline timeIntervalSinceNow]>0)
[[NSRunLoop currentRunLoop]runMode:NSDefaultRunLoopMode beforeDate:deadline];
NSDate *spiderDeadline=[NSDate dateWithTimeIntervalSinceNow:.2];
while(uiHost->_assetWrites==writesBeforeBurst+1&&[spiderDeadline timeIntervalSinceNow]>0)
[[NSRunLoop currentRunLoop]runMode:NSDefaultRunLoopMode beforeDate:spiderDeadline];
run.record(@"spider-paused-drag-writes-live-before-release",uiHost->_assetWrites==writesBeforeBurst+2&&[disc.meshData isEqual:DYReadAssets(uiHost,kCMTimeZero).spiderMesh]);
DYAssetState *external=[[DYReadAssets(uiHost,kCMTimeZero)copy]autorelease];
auto externalMesh=dy::neutralMesh(6,6);
@@ -68,8 +68,8 @@ static BOOL DYViewerSanitizeValue(NSDictionary *d,double input,double *output) {
NSDictionary *_snapshot,*_sourceDocument;NSString *_selectedNode;
CMTime _snapshotTime;
BOOL _invalidated,_validationScheduled;
uint64_t _requestSequence,_requestedGesture,_completedGesture,_pendingSpiderGesture;
NSData *_pendingSpiderMesh;
uint64_t _requestSequence,_requestedGesture,_completedGesture;
NSMutableDictionary<NSNumber*,NSData*> *_pendingSpiderMeshes;
// The fields below are confined to the main queue.
id<PROAPIAccessing> _writerHost,_writerTarget;
@@ -89,7 +89,7 @@ static BOOL DYViewerSanitizeValue(NSDictionary *d,double input,double *output) {
// the queued block keeps the bridge alive until its host group is closed.
NSCAssert(!_writerUndoOpen,@"Viewer parameter group must be closed before teardown");
[NSNotificationCenter.defaultCenter removeObserver:self];[_renderer release];[_selectedNode release];[_snapshot release];[_sourceDocument release];[_writerHost release];[_writerTarget release];
[_writerDescriptors release];[_writerLastValues release];[_writerCompanions release];[_writerNode release];[_writerType release];[_pendingSpiderMesh release];[super dealloc];
[_writerDescriptors release];[_writerLastValues release];[_writerCompanions release];[_writerNode release];[_writerType release];[_pendingSpiderMeshes release];[super dealloc];
}
- (void)publishAssets:(DYAssetState*)assets atTime:(CMTime)time {
@synchronized(self){if(_invalidated||!_snapshot||CMTimeCompare(time,_snapshotTime)!=0)return;NSMutableDictionary *next=[[_snapshot mutableCopy]autorelease];next[@"spider"]=assets.spiderMesh?:[NSData data];[_snapshot release];_snapshot=[next copy];}
@@ -311,10 +311,12 @@ static BOOL DYViewerSanitizeValue(NSDictionary *d,double input,double *output) {
- (void)flushSpiderGesture:(uint64_t)gesture {
NSData *mesh=nil;
@synchronized(self){
if(_invalidated||_pendingSpiderGesture!=gesture)return;
mesh=[_pendingSpiderMesh autorelease];_pendingSpiderMesh=nil;_pendingSpiderGesture=0;
if(_invalidated)return;
NSNumber *key=@(gesture);
mesh=[[_pendingSpiderMeshes[key]retain]autorelease];
[_pendingSpiderMeshes removeObjectForKey:key];
}
if(_writerGesture!=gesture||!_writerSpider||[mesh isEqual:_writerLastMesh])return;
if(!mesh||_writerGesture!=gesture||!_writerSpider||[mesh isEqual:_writerLastMesh])return;
id<FxCustomParameterActionAPI_v4>a=[_writerTarget apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)];
if(!a){[self closeWriter];return;}
BOOL changed=NO,failed=NO;
@@ -344,10 +346,11 @@ static BOOL DYViewerSanitizeValue(NSDictionary *d,double input,double *output) {
@synchronized(self){
if(_invalidated||!_requestedGesture)return;
uint64_t gesture=_requestedGesture;
[_pendingSpiderMesh release];_pendingSpiderMesh=[mesh copy];
if(_pendingSpiderGesture==gesture)return;
_pendingSpiderGesture=gesture;
dispatch_async(dispatch_get_main_queue(),^{[self flushSpiderGesture:gesture];});
NSNumber *key=@(gesture);
if(!_pendingSpiderMeshes)_pendingSpiderMeshes=[NSMutableDictionary new];
BOOL scheduled=_pendingSpiderMeshes[key]!=nil;
_pendingSpiderMeshes[key]=[[mesh copy]autorelease];
if(!scheduled)dispatch_async(dispatch_get_main_queue(),^{[self flushSpiderGesture:gesture];});
}
}
- (void)writeValues:(NSDictionary<NSString*,NSNumber*>*)values gesture:(uint64_t)gesture {
@@ -485,7 +488,7 @@ static BOOL DYViewerSanitizeValue(NSDictionary *d,double input,double *output) {
@synchronized(self){return !_invalidated&&gesture>_completedGesture;}
}
- (void)invalidate {
@synchronized(self){if(_invalidated)return;_invalidated=YES;_requestedGesture=0;_pendingSpiderGesture=0;[_pendingSpiderMesh release];_pendingSpiderMesh=nil;_apiManager=nil;}
@synchronized(self){if(_invalidated)return;_invalidated=YES;_requestedGesture=0;[_pendingSpiderMeshes removeAllObjects];_apiManager=nil;}
dispatch_async(dispatch_get_main_queue(),^{[self closeWriter];});
}
@end