Commit 6a414c06 authored by Gaëtan Renaudeau's avatar Gaëtan Renaudeau

iOS: rollback perf regression in drawRect

parent c0220cf7
...@@ -312,7 +312,6 @@ RCT_NOT_IMPLEMENTED(-init) ...@@ -312,7 +312,6 @@ RCT_NOT_IMPLEMENTED(-init)
if (imgData) contentData[i] = imgData; if (imgData) contentData[i] = imgData;
} }
_contentData = contentData; _contentData = contentData;
_deferredRendering = false;
[self setNeedsDisplay]; [self setNeedsDisplay];
RCT_PROFILE_END_EVENT(0, @"gl", nil); RCT_PROFILE_END_EVENT(0, @"gl", nil);
} }
...@@ -368,14 +367,13 @@ RCT_NOT_IMPLEMENTED(-init) ...@@ -368,14 +367,13 @@ RCT_NOT_IMPLEMENTED(-init)
return; return;
} }
bool willRender = !_deferredRendering; BOOL needsDeferredRendering = [_nbContentTextures intValue] > 0 && !_autoRedraw;
if (needsDeferredRendering && !_deferredRendering) {
if ([_nbContentTextures intValue] > 0 && !_autoRedraw) {
_deferredRendering = true; _deferredRendering = true;
[self performSelectorOnMainThread:@selector(syncContentData) withObject:nil waitUntilDone:NO]; [self performSelectorOnMainThread:@selector(syncContentData) withObject:nil waitUntilDone:NO];
} }
else {
if (willRender) { _deferredRendering = false;
[self render]; [self render];
if (_captureFrameRequested) { if (_captureFrameRequested) {
_captureFrameRequested = false; _captureFrameRequested = false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment