Skip to content
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

Conflict with GPUImage library #8

Closed
k06a opened this issue Jan 15, 2013 · 6 comments
Closed

Conflict with GPUImage library #8

k06a opened this issue Jan 15, 2013 · 6 comments

Comments

@k06a
Copy link

k06a commented Jan 15, 2013

I have crash while animation if simultaneously use GPUImage for another image filtering...
Details in this issue: BradLarson/GPUImage#761
What is my problem?

@Ciechan
Copy link
Owner

Ciechan commented Jan 15, 2013

Could you provide a pet project showing the issue, or at least provide a list of steps to recreate it?

@k06a
Copy link
Author

k06a commented Jan 15, 2013

I've just started animation and starting to filter an image => app fails. Only animation works perfect. Only image filtering works perfect. But both them not works...

@k06a
Copy link
Author

k06a commented Jan 15, 2013

I found a problem... This is how animation invokes GPUImage filtering.
Why animation makes relayout?

* thread #1: tid = 0x1c03, 0x000767fd Pictography`-[GPUImagePicture initWithCGImage:smoothlyScaleOutput:] + 173 at GPUImagePicture.m:39, stop reason = breakpoint 4.1
    frame #0: 0x000767fd Pictography`-[GPUImagePicture initWithCGImage:smoothlyScaleOutput:] + 173 at GPUImagePicture.m:39
    frame #1: 0x0007662a Pictography`-[GPUImagePicture initWithCGImage:] + 90 at GPUImagePicture.m:20
    frame #2: 0x000637ad Pictography`-[GPUImageFilter newCGImageByFilteringCGImage:orientation:] + 93 at GPUImageFilter.m:235
    frame #3: 0x000639a7 Pictography`-[GPUImageFilter imageByFilteringImage:] + 135 at GPUImageFilter.m:255
    frame #4: 0x00018097 Pictography`-[HNPSepiaImageFilter processImage:] + 103 at HNPSepiaImageFilter.m:25
    frame #5: 0x00011cf4 Pictography`-[HNPEditorViewController tableView:cellForRowAtIndexPath:] + 6132 at HNPEditorViewController.m:370
    frame #6: 0x007bcf4b UIKit`-[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] + 412
    frame #7: 0x007bd01f UIKit`-[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:] + 69
    frame #8: 0x007a580b UIKit`-[UITableView(_UITableViewPrivate) _updateVisibleCellsNow:] + 1863
    frame #9: 0x007b619b UIKit`-[UITableView layoutSubviews] + 241
    frame #10: 0x0075292d UIKit`-[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 279
    frame #11: 0x017ce6b0 libobjc.A.dylib`-[NSObject performSelector:withObject:] + 70
    frame #12: 0x00351fc0 QuartzCore`-[CALayer layoutSublayers] + 240
    frame #13: 0x0034633c QuartzCore`CA::Layer::layout_if_needed(CA::Transaction*) + 468
    frame #14: 0x00351eaf QuartzCore`-[CALayer layoutIfNeeded] + 166
    frame #15: 0x0034effe QuartzCore`-[CALayer renderInContext:] + 153
    frame #16: 0x00035b84 Pictography`-[UIView(Genie) renderSnapshotWithMarginForAxis:] + 420 at UIView+Genie.m:293
    frame #17: 0x0003312d Pictography`-[UIView(Genie) genieTransitionWithDuration:edge:destinationRect:reverse:completion:] + 413 at UIView+Genie.m:151
    frame #18: 0x00032f71 Pictography`-[UIView(Genie) genieOutTransitionWithDuration:startRect:startEdge:completion:] + 161 at UIView+Genie.m:128
    frame #19: 0x0001a932 Pictography`-[HNPHomeEditorSegue beginHomePushAnimation] + 2226 at HNPHomeEditorSegue.m:90
    frame #20: 0x0001ed42 Pictography`-[HNPHomeEditorSegue pushSegue] + 994 at HNPHomeEditorSegue.m:216
    frame #21: 0x0000a090 Pictography`-[HNPHomeViewController tableView:didSelectRowAtIndexPath:] + 2240 at HNPHomeViewController.m:435
    frame #22: 0x007b18d5 UIKit`-[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 1194
    frame #23: 0x007b1b3d UIKit`-[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 201
    frame #24: 0x011b8e83 Foundation`__NSFireDelayedPerform + 380
    frame #25: 0x0233b376 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22
    frame #26: 0x0233ae06 CoreFoundation`__CFRunLoopDoTimer + 534
    frame #27: 0x02322a82 CoreFoundation`__CFRunLoopRun + 1810
    frame #28: 0x02321f44 CoreFoundation`CFRunLoopRunSpecific + 276
    frame #29: 0x02321e1b CoreFoundation`CFRunLoopRunInMode + 123
    frame #30: 0x0270f7e3 GraphicsServices`GSEventRunModal + 88
    frame #31: 0x0270f668 GraphicsServices`GSEventRun + 104
    frame #32: 0x0070265c UIKit`UIApplicationMain + 1211
    frame #33: 0x00002de5 Pictography`main + 181 at main.m:16
    frame #34: 0x00002ce5 Pictography`start + 53

@Ciechan
Copy link
Owner

Ciechan commented Jan 15, 2013

As you can see in the call stack it's not me who is calling [CALayer layoutIfNeeded], it's the Apple's implementation of [CALayer renderInContext:]. Unfortunately I can't do anything about this, this is just how CoreAnimation works.

One solution I can think of is to temporarily disable call to [HNPSepiaImageFilter processImage:] inside [HNPEditorViewController tableView:cellForRowAtIndexPath:] when you know you're just about to animate using genie effect.

@k06a
Copy link
Author

k06a commented Jan 15, 2013

@Ciechan, thank you! I've solved problem - my table delegate was unready to cell creation while this update...

@Ciechan
Copy link
Owner

Ciechan commented Jan 15, 2013

I'm glad it works!

@Ciechan Ciechan closed this as completed Jan 15, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants