mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
[NoCopyRendering] Use vm instead of malloc (#833)
* [Contexts] Use mmap directly for possible perf gain and to tag the memory as CGImage * Wrap the mmap in an object * Go straight to dataprovider * Tweak it * Remove wrong comment * Finish that comment * Address warnings
This commit is contained in:
31
Source/ASCGImageBuffer.h
Normal file
31
Source/ASCGImageBuffer.h
Normal file
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// ASCGImageBuffer.h
|
||||
// Texture
|
||||
//
|
||||
// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <AsyncDisplayKit/ASBaseDefines.h>
|
||||
#import <CoreGraphics/CGDataProvider.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
AS_SUBCLASSING_RESTRICTED
|
||||
@interface ASCGImageBuffer : NSObject
|
||||
|
||||
- (instancetype)initWithLength:(NSUInteger)length;
|
||||
|
||||
@property (readonly) void *mutableBytes NS_RETURNS_INNER_POINTER;
|
||||
|
||||
/// Don't do any drawing or call any methods after calling this.
|
||||
- (CGDataProviderRef)createDataProviderAndInvalidate;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
Reference in New Issue
Block a user