diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_cocoa.mm | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index e2ddb8cc9..ffabb6e41 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -2273,22 +2273,25 @@ static FLTextInputContext* fltextinputcontext_instance = nil; } #endif through_drawRect = YES; - d->Fl_Window_Driver::flush(); - if (!through_Fl_X_flush) window->clear_damage(); #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_14 if (gc) { - if (!aux_bitmap) [self create_aux_bitmap:gc retina:d->mapped_to_retina()]; - if (CGBitmapContextGetBytesPerRow(gc) != CGBitmapContextGetBytesPerRow(aux_bitmap)) { - CGImageRef img = CGBitmapContextCreateImage(gc); - CGContextDrawImage(aux_bitmap, [self frame], img); - CGImageRelease(img); - } else { - memcpy(CGBitmapContextGetData(aux_bitmap), CGBitmapContextGetData(gc), CGBitmapContextGetHeight(gc) * CGBitmapContextGetBytesPerRow(gc)); + if (window->damage()) { + d->Fl_Window_Driver::flush(); + if (!aux_bitmap) [self create_aux_bitmap:gc retina:d->mapped_to_retina()]; + if (CGBitmapContextGetBytesPerRow(gc) != CGBitmapContextGetBytesPerRow(aux_bitmap)) { + CGImageRef img = CGBitmapContextCreateImage(gc); + CGContextDrawImage(aux_bitmap, [self frame], img); + CGImageRelease(img); + } else { + memcpy(CGBitmapContextGetData(aux_bitmap), CGBitmapContextGetData(gc), CGBitmapContextGetHeight(gc) * CGBitmapContextGetBytesPerRow(gc)); + } } Fl_Cocoa_Window_Driver::q_release_context(); direct_draw = NO; - } + } else #endif + d->Fl_Window_Driver::flush(); + if (!through_Fl_X_flush) window->clear_damage(); through_drawRect = NO; fl_unlock_function(); } |
