mac-capture: Use resize instead of reserve

Better practice for the tracked size to be nonzero.

This does NOT speed up window capture significantly.
master
jpark37 2020-05-09 09:12:48 -07:00
parent cc39efc6a4
commit 3d6bec6d2d
1 changed files with 1 additions and 1 deletions

View File

@ -51,7 +51,7 @@ static inline void capture_frame(struct window_capture *wc)
size_t height = CGImageGetHeight(img);
CGRect rect = {{0, 0}, {width, height}};
da_reserve(wc->buffer, width * height * 4);
da_resize(wc->buffer, width * height * 4);
uint8_t *data = wc->buffer.array;
CGContextRef cg_context = CGBitmapContextCreate(