0
我有以下代碼,我使用的視圖的內容捕捉到的圖像:繪製到GPU的圖形屏幕捕獲?
if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)])
{
UIGraphicsBeginImageContextWithOptions(self.mainView.bounds.size, NO, [UIScreen mainScreen].scale);
}
else
{
UIGraphicsBeginImageContext(self.mainView.bounds.size);
}
[self.mainView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = [UIGraphicsGetImageFromCurrentImageContext() retain];
最近,我試圖附連GLKView
(我使用實時應用在GPU核心圖片過濾器)到mainView
。當我執行上面的代碼時,它不會捕獲GLKView
中的圖形(而是基本上忽略它)。
所以我的問題是,是否有可能將圖形捕獲到GPU上繪製的圖像上,但尚未被複制回CPU?