nicklockwood / FXBlurView

[DEPRECATED]
Other
4.94k stars 713 forks source link

Issue with child GLKViewController #102

Open ldantona opened 9 years ago

ldantona commented 9 years ago

When the main view controller contains a child view controller which is a GLKViewController, adding a blurred view to the parent vc doesn't take into account any content of the child vc.

I'm not sure whether the problem is the OpenGL content or the library itself doesn't work with child vc, anyway in FXBlurView.m, snapshotOfUnderlyingView method, I've switched: [underlyingLayer renderInContext:context]; with: [underlyingView drawViewHierarchyInRect:self.bounds afterScreenUpdates:YES]; and now it seems to work.

nicklockwood commented 9 years ago

This is a known (documented) issue. The solution you've found will work, but the performance is slower for live updates.

ldantona commented 9 years ago

Hi Nick! Thanks for your quick answer. Reading Apple's documentation it seems that drawViewHierarchyInRect should be faster than renderInContext, but are you saying that in our context the performance is slower? Is there any workaround for this?

nicklockwood commented 9 years ago

It should be faster, but when I tried it I found that the performance with drawViewHierarchy was disastrously slow. I haven't tested it on iOS8 though, so it may have improved.