Implement adaptive inspector and responsive canvas controls for 1.12.1
这个提交包含在:
1 父节点
91b66eb2d8
当前提交
585c83c8a1
21 个文件已更改
+316
-68
没有与搜索条件相匹配的文件
@@ -33,6 +33,13 @@
|
||||
[(id)osc setValue:[NSValue valueWithRect:view]forKey:@"imageRect"];[(id)osc setValue:@2 forKey:@"uiScale"];NSRect visible=NSIntersectionRect(view,NSMakeRect(0,0,640,400));
|
||||
for(NSInteger i=9;i<=10;i++)penActionsBounded&=NSContainsRect(visible,[(id)osc toolbarRectForItem:i]);}
|
||||
run.record(@"native-osc-keeps-only-two-pen-actions-bounded-at-bottom",penActionsBounded);
|
||||
NSColor *white=[NSColor colorWithSRGBRed:.82 green:.64 blue:.52 alpha:1];
|
||||
auto whiteBalance=[&](CMTime time){[NSNotificationCenter.defaultCenter postNotificationName:@"DYWhiteBalanceColor" object:host userInfo:@{@"time":[NSValue valueWithCMTime:time],@"color":white}];drain();};
|
||||
NSDictionary *beforeWhite=[[base->_values copy]autorelease];undo=base->_undoStarts;whiteBalance(CMTimeMake(1,24));
|
||||
run.record(@"canvas-white-balance-cannot-write-after-the-playhead-moves",[beforeWhite isEqual:base->_values]&&base->_undoStarts==undo);
|
||||
whiteBalance(kCMTimeZero);DYUniforms balanced;DYReadUniforms(host,kCMTimeZero,&balanced);
|
||||
float temp=0,tint=0;[DYColorTables neutralizeColor:(vector_float3){.82f,.64f,.52f} temperature:&temp tint:&tint];
|
||||
run.record(@"canvas-white-balance-uses-existing-solver-and-one-undo",fabs(balanced.temperature-temp)<1e-4&&fabs(balanced.tint-tint)<1e-4&&base->_undoStarts==undo+1&&base->_undoEnds==undo+1);
|
||||
[osc release];[plugin release];drain();
|
||||
}
|
||||
{
|
||||
@@ -59,3 +66,24 @@
|
||||
[osc mouseDownAtPositionX:488 positionY:149.5 activePart:1 modifiers:0 forceUpdate:&update atTime:kCMTimeZero];[osc mouseUpAtPositionX:208 positionY:275.5 activePart:1 modifiers:0 forceUpdate:&update atTime:kCMTimeZero];drain();p=DYMaskAtTime(DYSharedMaskWithID(DYReadTools(base,kCMTimeZero).document,maskID),kCMTimeZero);run.record(@"native-osc-ellipse-draws-reverse-direction-with-positive-shared-extents",p.kind==DYMaskEllipse&&fabs(p.centerX-.55)<1e-5&&fabs(p.centerY-.5)<1e-5&&fabs(p.width-.5)<1e-5&&fabs(p.height-.4)<1e-5&&base->_undoStarts==undo+1&&base->_undoEnds==undo+1);
|
||||
[osc release];[plugin release];drain();
|
||||
}
|
||||
|
||||
{
|
||||
DYDiagnosticManager *base=[[[DYDiagnosticManager alloc]init]autorelease];DYCreateParameters(base,nil);
|
||||
DYToolCanvasProbe *host=[[[DYToolCanvasProbe alloc]init]autorelease];host->_base=base;host->_time=kCMTimeZero;
|
||||
id<DYToolCanvasHostProbe> plugin=(id)[[NSClassFromString(@"DYPlugIn")alloc]initWithAPIManager:host];
|
||||
DYDiagnosticTile *src=[[[DYDiagnosticTile alloc]initWithDevice:gpu width:16 height:16]autorelease],*dst=[[[DYDiagnosticTile alloc]initWithDevice:gpu width:16 height:16]autorelease];
|
||||
Pixels pixels(16*16*4);for(size_t i=0;i<pixels.size();i++)pixels[i]=i%4==3?1:.18f;
|
||||
[[src metalTextureForDevice:gpu]replaceRegion:MTLRegionMake2D(0,0,16,16)mipmapLevel:0 withBytes:pixels.data()bytesPerRow:16*8];
|
||||
id<DYViewerParameterProbe> bridge=[(id)plugin valueForKey:@"viewerParameterBridge"];
|
||||
auto histogram=[&]()->NSData*{NSData *state=nil;NSError *failure=nil;
|
||||
if(![plugin pluginState:&state atTime:kCMTimeZero quality:(FxQuality)0 error:&failure])return nil;
|
||||
if(![(id<FxTileableEffect>)plugin renderDestinationImage:dst sourceImages:@[src] pluginState:state atTime:kCMTimeZero error:&failure])return nil;
|
||||
return [bridge canvasHistogramAtTime:kCMTimeZero];
|
||||
};
|
||||
NSData *before=histogram();
|
||||
for(NSDictionary *d in DYDescriptors())if([@[@"masterX0",@"curveY0"]containsObject:d[@"key"]])
|
||||
[(id<FxParameterSettingAPI_v6>)base setFloatValue:[d[@"key"]isEqual:@"masterX0"]?.5:32 toParameter:[d[@"pid"]unsignedIntValue] atTime:kCMTimeZero];
|
||||
NSData *after=histogram();
|
||||
run.record(@"canvas-curve-histogram-updates-from-final-output-at-the-same-playhead",before.length==sizeof(DYHistogram)&&after.length==sizeof(DYHistogram)&&![before isEqual:after]&&![bridge canvasHistogramAtTime:CMTimeMake(1,24)]);
|
||||
[plugin release];
|
||||
}
|
||||
在新工单中引用
屏蔽一个用户