Revision: 13292
http://sourceforge.net/p/skim-app/code/13292
Author: hofman
Date: 2023-02-09 15:29:19 +0000 (Thu, 09 Feb 2023)
Log Message:
-----------
Draw superview of metal view for initial frame of transition, as the metal view
requires time to draw its content. No need to prepare the transition view
anymore.
Modified Paths:
--------------
trunk/SKMainWindowController_FullScreen.m
trunk/SKPDFView.h
trunk/SKPDFView.m
trunk/SKTransitionController.h
trunk/SKTransitionController.m
Modified: trunk/SKMainWindowController_FullScreen.m
===================================================================
--- trunk/SKMainWindowController_FullScreen.m 2023-02-05 10:40:16 UTC (rev
13291)
+++ trunk/SKMainWindowController_FullScreen.m 2023-02-09 15:29:19 UTC (rev
13292)
@@ -439,8 +439,6 @@
[self fadeInFullScreenView];
- [pdfView prepareTransitionView];
-
if ([[[self pdfView] currentPage] isEqual:page] == NO)
[[self pdfView] goToCurrentPage:page];
Modified: trunk/SKPDFView.h
===================================================================
--- trunk/SKPDFView.h 2023-02-05 10:40:16 UTC (rev 13291)
+++ trunk/SKPDFView.h 2023-02-09 15:29:19 UTC (rev 13292)
@@ -202,8 +202,6 @@
- (void)togglePacer;
-- (void)prepareTransitionView;
-
- (IBAction)delete:(id)sender;
- (IBAction)paste:(id)sender;
- (IBAction)alternatePaste:(id)sender;
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2023-02-05 10:40:16 UTC (rev 13291)
+++ trunk/SKPDFView.m 2023-02-09 15:29:19 UTC (rev 13292)
@@ -1029,10 +1029,6 @@
return transitionController;
}
-- (void)prepareTransitionView {
- [transitionController prepareViewIfNeeded];
-}
-
- (void)setHighlightAnnotation:(PDFAnnotation *)annotation {
if (annotation != highlightAnnotation) {
[highlightAnnotation release];
Modified: trunk/SKTransitionController.h
===================================================================
--- trunk/SKTransitionController.h 2023-02-05 10:40:16 UTC (rev 13291)
+++ trunk/SKTransitionController.h 2023-02-09 15:29:19 UTC (rev 13292)
@@ -65,6 +65,4 @@
- (void)animateForRect:(NSRect)rect from:(NSUInteger)fromIndex
to:(NSUInteger)toIndex change:(NSRect (^)(void))change;
-- (void)prepareViewIfNeeded;
-
@end
Modified: trunk/SKTransitionController.m
===================================================================
--- trunk/SKTransitionController.m 2023-02-05 10:40:16 UTC (rev 13291)
+++ trunk/SKTransitionController.m 2023-02-09 15:29:19 UTC (rev 13292)
@@ -420,7 +420,6 @@
[transitionView removeFromSuperview];
[transitionView setFilter:nil];
[transitionView setImage:nil];
- [transitionView setAlphaValue:1.0];
}
- (void)showTransitionWindowForRect:(NSRect)rect image:(CIImage *)image
extent:(CGRect)extent {
@@ -451,20 +450,6 @@
[tView setImage:nil];
}
-- (void)prepareViewIfNeeded {
- if ([self hasTransition]) {
- // shortly add the transition view with the current image
- // this prevents a flickering at the first transition
- NSRect bounds = [view bounds];
- CGFloat imageScale = 1.0;
- CIImage *image = [self currentImageForRect:bounds scale:&imageScale];
- CGRect cgBounds = scaleRect(bounds, imageScale);
- [self showTransitionViewForRect:bounds image:image extent:cgBounds];
- [transitionView setAlphaValue:0.0];
- [self performSelector:@selector(removeTransitionView) withObject:nil
afterDelay:0.0];
- }
-}
-
- (void)animateForRect:(NSRect)rect from:(NSUInteger)fromIndex
to:(NSUInteger)toIndex change:(NSRect (^)(void))change {
if (animating) {
change();
@@ -788,11 +773,25 @@
- (void)setProgress:(CGFloat)newProgress {
if (filter) {
[filter setValue:[NSNumber numberWithDouble:newProgress]
forKey:kCIInputTimeKey];
- [self setImage:[filter outputImage]];
- [[[self subviews] firstObject] setNeedsDisplay:YES];
+ [image release];
+ image = [[filter outputImage] retain];
+ NSView *metalView = [[self subviews] firstObject];
+ [metalView setAlphaValue:1.0];
+ [metalView setNeedsDisplay:YES];
+ [self setNeedsDisplay:YES];
}
}
+- (void)setImage:(CIImage *)newImage {
+ if (newImage != image) {
+ [image release];
+ image = [newImage retain];
+ NSView *metalView = [[self subviews] firstObject];
+ [metalView setAlphaValue:0.0];
+ [metalView setNeedsDisplay:YES];
+ }
+}
+
- (void)drawInMTKView:(MTKView *)view {
if (image == nil)
return;
@@ -821,4 +820,12 @@
- (void)mtkView:(MTKView *)view drawableSizeWillChange:(CGSize)size {}
+- (void)drawRect:(NSRect)rect {
+ if ([[[self subviews] firstObject] alphaValue] <= 0.0) {
+ [[NSColor blackColor] setFill];
+ NSRectFill(rect);
+ [image drawInRect:[self bounds] fromRect:extent
operation:NSCompositeSourceOver fraction:1.0];
+ }
+}
+
@end
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit