mirror of
https://github.com/darlinghq/darling-cocotron.git
synced 2024-11-23 04:00:00 +00:00
Build CGLPixelSurface
This commit is contained in:
parent
73c051bcb3
commit
74900145cc
@ -383,7 +383,6 @@ add_framework(AppKit
|
||||
system
|
||||
CoreFoundation
|
||||
Foundation
|
||||
CoreGraphics
|
||||
Onyx2D
|
||||
CoreText
|
||||
# native libraries
|
||||
@ -396,4 +395,5 @@ add_framework(AppKit
|
||||
CIRCULAR_DEPENDENCIES
|
||||
OpenGL
|
||||
QuartzCore
|
||||
CoreGraphics
|
||||
)
|
||||
|
@ -1,7 +1,13 @@
|
||||
#import <CoreGraphics/CGLPixelSurface.h>
|
||||
#import <CoreGraphics/CGWindow.h>
|
||||
#import <Onyx2D/O2Image.h>
|
||||
|
||||
// this should be fixed upstream
|
||||
#ifndef DARLING
|
||||
#import <AppKit/O2Surface_DIBSection.h>
|
||||
#else
|
||||
#import <AppKit/O2Surface_cairo.h>
|
||||
#endif
|
||||
|
||||
@implementation CGLPixelSurface
|
||||
|
||||
@ -59,7 +65,11 @@
|
||||
_bufferObjects=malloc(_numberOfBuffers*sizeof(GLuint));
|
||||
_readPixels=malloc(_numberOfBuffers*sizeof(void *));
|
||||
_staticPixels=malloc(_numberOfBuffers*sizeof(void *));
|
||||
#ifndef DARLING
|
||||
_surface=[[O2Surface_DIBSection alloc] initWithWidth:_width height:-_height compatibleWithDeviceContext:nil];
|
||||
#else
|
||||
_surface=[[O2Surface_cairo alloc] initWithWidth:_width height:-_height compatibleWithContext:nil];
|
||||
#endif
|
||||
|
||||
for(i=0;i<_numberOfBuffers;i++){
|
||||
_bufferObjects[i]=0;
|
||||
@ -251,7 +261,7 @@ static inline uint32_t premultiplyPixel(uint32_t value){
|
||||
}
|
||||
|
||||
-(NSString *)description {
|
||||
return [NSString stringWithFormat:@"<%@ %p:size={ %d %d } surface=%@",isa,self,_width,_height,_surface];
|
||||
return [NSString stringWithFormat:@"<%@ %p:size={ %d %d } surface=%@", [self class], self, _width, _height, _surface];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -11,6 +11,9 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
-mmacosx-version-min=10.10"
|
||||
)
|
||||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(PC_CAIRO cairo)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_SOURCE_DIR}/src/external/foundation/include
|
||||
${CMAKE_SOURCE_DIR}/src/external/foundation/include/Foundation
|
||||
@ -32,6 +35,8 @@ include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/..
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../CoreText
|
||||
|
||||
${PC_CAIRO_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
set(CoreGraphics_sources
|
||||
@ -53,7 +58,7 @@ set(CoreGraphics_sources
|
||||
CGImageProperties.m
|
||||
CGImageSource.m
|
||||
CGLayer.m
|
||||
# CGLPixelSurface.m
|
||||
CGLPixelSurface.m
|
||||
CGPath.m
|
||||
CGPattern.m
|
||||
CGPDFContext.m
|
||||
@ -78,4 +83,8 @@ add_framework(CoreGraphics
|
||||
CoreFoundation
|
||||
Foundation
|
||||
Onyx2D
|
||||
GL
|
||||
CIRCULAR_DEPENDENCIES
|
||||
AppKit
|
||||
OpenGL
|
||||
)
|
||||
|
@ -73,10 +73,10 @@ add_framework(QuartzCore
|
||||
system
|
||||
CoreFoundation
|
||||
Foundation
|
||||
CoreGraphics
|
||||
Onyx2D
|
||||
# native libraries
|
||||
GL
|
||||
CIRCULAR_DEPENDENCIES
|
||||
OpenGL
|
||||
CoreGraphics
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user