[C API] Cleaned up the C bits and added support for managed streams
This commit is contained in:
Родитель
d64e70ef06
Коммит
753211d317
|
@ -6,16 +6,31 @@ include $(CLEAR_VARS)
|
|||
PRIVATE_STRIP = echo
|
||||
LOCAL_WHOLE_STATIC_LIBRARIES := libskia_core libskia_effects libskia_utils
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := libskia_ports libskia_skgpu \
|
||||
libskia_images libskia_opts libfreetype_static libpng_static libexpat libSkKTX libetc1 \
|
||||
libskia_sfnt libpng_static_neon libskia_opts_neon libskia_opts_avx libskia_opts_ssse3 libskia_opts_sse41 libcpu_features
|
||||
LOCAL_STATIC_LIBRARIES := libskia_ports libskia_skgpu libskia_images libskia_opts \
|
||||
libfreetype_static libpng_static libexpat libSkKTX libetc1 \
|
||||
libskia_sfnt libpng_static_neon libskia_opts_neon \
|
||||
libskia_opts_avx libskia_opts_ssse3 libskia_opts_sse41 \
|
||||
libcpu_features
|
||||
|
||||
LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv2 -lz
|
||||
LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv2 -lz
|
||||
|
||||
LOCAL_MODULE := skia_android
|
||||
LOCAL_C_INCLUDES := ../../skia/include/c
|
||||
LOCAL_CFLAGS += -DNEED_INIT_NEON
|
||||
LOCAL_SRC_FILES := skia_android/skia_android.cpp
|
||||
|
||||
LOCAL_C_INCLUDES := ../../skia/src/c ../../skia/include/c ../../skia/include/core ../../skia/include/config
|
||||
|
||||
LOCAL_CFLAGS := -DSK_INTERNAL -DSK_GAMMA_APPLY_TO_A8 \
|
||||
-DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0 -DSK_SUPPORT_GPU=1 \
|
||||
-DSK_SUPPORT_OPENCL=0 -DSK_FORCE_DISTANCE_FIELD_TEXT=0 \
|
||||
-DSK_BUILD_FOR_ANDROID -DSK_GAMMA_EXPONENT=1.4 -DSK_GAMMA_CONTRAST=0.0 \
|
||||
-DSKIA_DLL -DSKIA_IMPLEMENTATION=1 -DSK_SUPPORT_LEGACY_CLIPTOLAYERFLAG \
|
||||
-DNDEBUG -DNEED_INIT_NEON \
|
||||
-fPIC -g -fno-exceptions -fstrict-aliasing -Wall -Wextra \
|
||||
-Winit-self -Wpointer-arith -Wsign-compare -Wno-unused-parameter \
|
||||
-Werror -fuse-ld=gold -O2
|
||||
|
||||
LOCAL_CPPFLAGS := -std=c++11 -fno-rtti -fno-threadsafe-statics -Wnon-virtual-dtor
|
||||
|
||||
LOCAL_SRC_FILES := ../../src/sk_xamarin.cpp ../../src/SkiaKeeper.c ../../src/sk_managedstream.cpp ../../src/SkManagedStream.cpp
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
|
||||
|
||||
#include "sk_surface.h"
|
||||
#include "sk_paint.h"
|
||||
#include "sk_typeface.h"
|
||||
|
||||
__attribute__((visibility("default"))) void** KeepSkiaCSymbols ();
|
||||
|
||||
|
||||
void** KeepSkiaCSymbols ()
|
||||
{
|
||||
static void* ret[3] = {(void*)sk_surface_unref, (void*)sk_paint_new, (void*)sk_typeface_unref};
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef NEED_INIT_NEON
|
||||
|
||||
namespace SkOpts {
|
||||
void Init_neon() {}
|
||||
}
|
||||
|
||||
#endif
|
|
@ -8,8 +8,6 @@
|
|||
|
||||
/* Begin PBXBuildFile section */
|
||||
21FD2B341C014C000023CFAE /* libskia_ios.h in Headers */ = {isa = PBXBuildFile; fileRef = 21FD2B331C014C000023CFAE /* libskia_ios.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
21FD2B441C014CA60023CFAE /* SkiaKeeper.c in Sources */ = {isa = PBXBuildFile; fileRef = 21FD2B421C014CA60023CFAE /* SkiaKeeper.c */; };
|
||||
21FD2B451C014CA60023CFAE /* SkiaKeeper.h in Headers */ = {isa = PBXBuildFile; fileRef = 21FD2B431C014CA60023CFAE /* SkiaKeeper.h */; };
|
||||
21FD2D831C0165370023CFAE /* libskia_core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 21FD2D0E1C015ED70023CFAE /* libskia_core.a */; };
|
||||
21FD2D841C0165510023CFAE /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 21FD2D411C015F780023CFAE /* libc++.tbd */; };
|
||||
21FD2D871C0165880023CFAE /* libskia_skgpu.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 21FD2D141C015ED70023CFAE /* libskia_skgpu.a */; };
|
||||
|
@ -26,6 +24,13 @@
|
|||
21FD2DA51C01677B0023CFAE /* ImageIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 21FD2DA41C01677B0023CFAE /* ImageIO.framework */; };
|
||||
21FD2DA71C0167950023CFAE /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 21FD2DA61C0167950023CFAE /* CoreGraphics.framework */; };
|
||||
21FD2DA91C0167E60023CFAE /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 21FD2DA81C0167E60023CFAE /* MobileCoreServices.framework */; };
|
||||
3403038C1C404F6B00630F26 /* sk_xamarin.h in Headers */ = {isa = PBXBuildFile; fileRef = 3403038B1C404F6B00630F26 /* sk_xamarin.h */; };
|
||||
340303941C4053E500630F26 /* sk_managedstream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 340303901C4053E500630F26 /* sk_managedstream.cpp */; };
|
||||
340303951C4053E500630F26 /* sk_managedstream.h in Headers */ = {isa = PBXBuildFile; fileRef = 340303911C4053E500630F26 /* sk_managedstream.h */; };
|
||||
340303961C4053E500630F26 /* SkManagedStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 340303921C4053E500630F26 /* SkManagedStream.cpp */; };
|
||||
340303971C4053E500630F26 /* SkManagedStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 340303931C4053E500630F26 /* SkManagedStream.h */; };
|
||||
340303DB1C40877300630F26 /* sk_xamarin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 340303DA1C40877300630F26 /* sk_xamarin.cpp */; };
|
||||
343DAE471C3F285700FAD826 /* SkiaKeeper.c in Sources */ = {isa = PBXBuildFile; fileRef = 343DAE451C3F285700FAD826 /* SkiaKeeper.c */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
|
@ -238,8 +243,6 @@
|
|||
21FD2B301C014C000023CFAE /* libskia_ios.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = libskia_ios.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
21FD2B331C014C000023CFAE /* libskia_ios.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = libskia_ios.h; sourceTree = "<group>"; };
|
||||
21FD2B351C014C000023CFAE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
21FD2B421C014CA60023CFAE /* SkiaKeeper.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SkiaKeeper.c; sourceTree = "<group>"; };
|
||||
21FD2B431C014CA60023CFAE /* SkiaKeeper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SkiaKeeper.h; sourceTree = "<group>"; };
|
||||
21FD2CE11C015ED60023CFAE /* codec_android.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = codec_android.xcodeproj; path = ../../skia/out/gyp/codec_android.xcodeproj; sourceTree = "<group>"; };
|
||||
21FD2CE41C015ED60023CFAE /* codec.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = codec.xcodeproj; path = ../../skia/out/gyp/codec.xcodeproj; sourceTree = "<group>"; };
|
||||
21FD2CEC1C015ED60023CFAE /* core.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = core.xcodeproj; path = ../../skia/out/gyp/core.xcodeproj; sourceTree = "<group>"; };
|
||||
|
@ -258,6 +261,13 @@
|
|||
21FD2DA41C01677B0023CFAE /* ImageIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ImageIO.framework; path = System/Library/Frameworks/ImageIO.framework; sourceTree = SDKROOT; };
|
||||
21FD2DA61C0167950023CFAE /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
|
||||
21FD2DA81C0167E60023CFAE /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; };
|
||||
3403038B1C404F6B00630F26 /* sk_xamarin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sk_xamarin.h; path = "/Users/matthew/projects/SkiaSharp/gyp/../native-builds/src/sk_xamarin.h"; sourceTree = "<absolute>"; };
|
||||
340303901C4053E500630F26 /* sk_managedstream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = sk_managedstream.cpp; path = "/Users/matthew/projects/SkiaSharp/native-builds/libskia_osx/../src/sk_managedstream.cpp"; sourceTree = "<absolute>"; };
|
||||
340303911C4053E500630F26 /* sk_managedstream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sk_managedstream.h; path = "/Users/matthew/projects/SkiaSharp/gyp/../native-builds/src/sk_managedstream.h"; sourceTree = "<absolute>"; };
|
||||
340303921C4053E500630F26 /* SkManagedStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkManagedStream.cpp; path = "/Users/matthew/projects/SkiaSharp/gyp/../native-builds/src/SkManagedStream.cpp"; sourceTree = "<absolute>"; };
|
||||
340303931C4053E500630F26 /* SkManagedStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkManagedStream.h; path = "/Users/matthew/projects/SkiaSharp/gyp/../native-builds/src/SkManagedStream.h"; sourceTree = "<absolute>"; };
|
||||
340303DA1C40877300630F26 /* sk_xamarin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = sk_xamarin.cpp; path = ../../src/sk_xamarin.cpp; sourceTree = "<group>"; };
|
||||
343DAE451C3F285700FAD826 /* SkiaKeeper.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SkiaKeeper.c; path = ../../src/SkiaKeeper.c; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
|
@ -292,7 +302,7 @@
|
|||
children = (
|
||||
21FD2D411C015F780023CFAE /* libc++.tbd */,
|
||||
21FD2B3B1C014C110023CFAE /* skia_libs */,
|
||||
21FD2B321C014C000023CFAE /* libskia_ios */,
|
||||
21FD2B321C014C000023CFAE /* Source */,
|
||||
21FD2B311C014C000023CFAE /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
|
@ -305,14 +315,20 @@
|
|||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
21FD2B321C014C000023CFAE /* libskia_ios */ = {
|
||||
21FD2B321C014C000023CFAE /* Source */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
340303901C4053E500630F26 /* sk_managedstream.cpp */,
|
||||
340303911C4053E500630F26 /* sk_managedstream.h */,
|
||||
340303921C4053E500630F26 /* SkManagedStream.cpp */,
|
||||
340303931C4053E500630F26 /* SkManagedStream.h */,
|
||||
340303DA1C40877300630F26 /* sk_xamarin.cpp */,
|
||||
3403038B1C404F6B00630F26 /* sk_xamarin.h */,
|
||||
343DAE451C3F285700FAD826 /* SkiaKeeper.c */,
|
||||
21FD2B331C014C000023CFAE /* libskia_ios.h */,
|
||||
21FD2B351C014C000023CFAE /* Info.plist */,
|
||||
21FD2B421C014CA60023CFAE /* SkiaKeeper.c */,
|
||||
21FD2B431C014CA60023CFAE /* SkiaKeeper.h */,
|
||||
);
|
||||
name = Source;
|
||||
path = libskia_ios;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
|
@ -450,8 +466,10 @@
|
|||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
21FD2B451C014CA60023CFAE /* SkiaKeeper.h in Headers */,
|
||||
21FD2B341C014C000023CFAE /* libskia_ios.h in Headers */,
|
||||
3403038C1C404F6B00630F26 /* sk_xamarin.h in Headers */,
|
||||
340303971C4053E500630F26 /* SkManagedStream.h in Headers */,
|
||||
340303951C4053E500630F26 /* sk_managedstream.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -718,7 +736,10 @@
|
|||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
21FD2B441C014CA60023CFAE /* SkiaKeeper.c in Sources */,
|
||||
340303DB1C40877300630F26 /* sk_xamarin.cpp in Sources */,
|
||||
343DAE471C3F285700FAD826 /* SkiaKeeper.c in Sources */,
|
||||
340303941C4053E500630F26 /* sk_managedstream.cpp in Sources */,
|
||||
340303961C4053E500630F26 /* SkManagedStream.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -782,7 +803,7 @@
|
|||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
|
@ -801,13 +822,21 @@
|
|||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_C_LANGUAGE_STANDARD = c11;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
SK_INTERNAL,
|
||||
SK_GAMMA_SRGB,
|
||||
SK_GAMMA_APPLY_TO_A8,
|
||||
"SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=1",
|
||||
"SK_SUPPORT_GPU=1",
|
||||
"SK_SUPPORT_OPENCL=0",
|
||||
"SK_FORCE_DISTANCE_FIELD_TEXT=0",
|
||||
SK_BUILD_FOR_IOS,
|
||||
SKIA_DLL,
|
||||
"SK_DEVELOPER=1",
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
|
@ -830,7 +859,7 @@
|
|||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
|
@ -849,8 +878,20 @@
|
|||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_C_LANGUAGE_STANDARD = c11;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
SK_INTERNAL,
|
||||
SK_GAMMA_SRGB,
|
||||
SK_GAMMA_APPLY_TO_A8,
|
||||
"SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=1",
|
||||
"SK_SUPPORT_GPU=1",
|
||||
"SK_SUPPORT_OPENCL=0",
|
||||
"SK_FORCE_DISTANCE_FIELD_TEXT=0",
|
||||
SK_BUILD_FOR_IOS,
|
||||
SKIA_DLL,
|
||||
NDEBUG,
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
|
@ -875,11 +916,22 @@
|
|||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
HEADER_SEARCH_PATHS = ../../skia/include/c;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
../../skia/src/c,
|
||||
../../skia/include/c,
|
||||
../../skia/include/core,
|
||||
../../skia/include/config,
|
||||
);
|
||||
INFOPLIST_FILE = libskia_ios/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
LIBRARY_SEARCH_PATHS = ../ios;
|
||||
OTHER_CPLUSPLUSFLAGS = (
|
||||
"-std=c++0x",
|
||||
"-stdlib=libc++",
|
||||
"-fvisibility=hidden",
|
||||
"-fvisibility-inlines-hidden",
|
||||
);
|
||||
OTHER_LDFLAGS = "";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "xamarin.libskia-ios";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
|
@ -894,11 +946,22 @@
|
|||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
HEADER_SEARCH_PATHS = ../../skia/include/c;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
../../skia/src/c,
|
||||
../../skia/include/c,
|
||||
../../skia/include/core,
|
||||
../../skia/include/config,
|
||||
);
|
||||
INFOPLIST_FILE = libskia_ios/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
LIBRARY_SEARCH_PATHS = ../ios;
|
||||
OTHER_CPLUSPLUSFLAGS = (
|
||||
"-std=c++0x",
|
||||
"-stdlib=libc++",
|
||||
"-fvisibility=hidden",
|
||||
"-fvisibility-inlines-hidden",
|
||||
);
|
||||
OTHER_LDFLAGS = "";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "xamarin.libskia-ios";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
//
|
||||
// SkiaKeeper.c
|
||||
// libskia_ios
|
||||
//
|
||||
// Created by Bill Holmes on 11/21/15.
|
||||
// Copyright © 2015 Xamarin. All rights reserved.
|
||||
//
|
||||
|
||||
#include "SkiaKeeper.h"
|
||||
|
||||
#include "sk_surface.h"
|
||||
#include "sk_paint.h"
|
||||
#include "sk_typeface.h"
|
||||
|
||||
|
||||
|
||||
void** KeepSkiaCSymbols ()
|
||||
{
|
||||
static void* ret[3] = {sk_surface_unref, sk_paint_new, sk_typeface_unref};
|
||||
|
||||
return ret;
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
//
|
||||
// SkiaKeeper.h
|
||||
// libskia_ios
|
||||
//
|
||||
// Created by Bill Holmes on 11/21/15.
|
||||
// Copyright © 2015 Xamarin. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef SkiaKeeper_h
|
||||
#define SkiaKeeper_h
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#endif /* SkiaKeeper_h */
|
|
@ -7,8 +7,6 @@
|
|||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
21C951631C03D2B1003A1E1D /* SkiaKeeper.c in Sources */ = {isa = PBXBuildFile; fileRef = 21C951611C03D2B1003A1E1D /* SkiaKeeper.c */; };
|
||||
21C951641C03D2B1003A1E1D /* SkiaKeeper.h in Headers */ = {isa = PBXBuildFile; fileRef = 21C951621C03D2B1003A1E1D /* SkiaKeeper.h */; };
|
||||
21C951BA1C03D3DB003A1E1D /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 21C951B91C03D3DB003A1E1D /* CoreFoundation.framework */; };
|
||||
21C951BC1C03D3EA003A1E1D /* ImageIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 21C951BB1C03D3EA003A1E1D /* ImageIO.framework */; };
|
||||
21C951BE1C03D3FD003A1E1D /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 21C951BD1C03D3FD003A1E1D /* CoreServices.framework */; };
|
||||
|
@ -28,6 +26,13 @@
|
|||
21C951DF1C03D507003A1E1D /* libSkKTX.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 21C951DC1C03D4F9003A1E1D /* libSkKTX.a */; };
|
||||
21C951EC1C03D53B003A1E1D /* libskia_utils.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 21C951E71C03D528003A1E1D /* libskia_utils.a */; };
|
||||
21C951F51C03D55F003A1E1D /* libetc1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 21C951F21C03D551003A1E1D /* libetc1.a */; };
|
||||
340303831C404C3D00630F26 /* sk_xamarin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 340303821C404C3D00630F26 /* sk_xamarin.cpp */; };
|
||||
3403038F1C404FD100630F26 /* sk_xamarin.h in Headers */ = {isa = PBXBuildFile; fileRef = 3403038E1C404FD100630F26 /* sk_xamarin.h */; };
|
||||
3403039C1C40543C00630F26 /* sk_managedstream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 340303981C40543C00630F26 /* sk_managedstream.cpp */; };
|
||||
3403039D1C40543C00630F26 /* sk_managedstream.h in Headers */ = {isa = PBXBuildFile; fileRef = 340303991C40543C00630F26 /* sk_managedstream.h */; };
|
||||
3403039E1C40543C00630F26 /* SkManagedStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3403039A1C40543C00630F26 /* SkManagedStream.cpp */; };
|
||||
3403039F1C40543C00630F26 /* SkManagedStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 3403039B1C40543C00630F26 /* SkManagedStream.h */; };
|
||||
343DAE301C3F26CF00FAD826 /* SkiaKeeper.c in Sources */ = {isa = PBXBuildFile; fileRef = 343DAE2E1C3F26CF00FAD826 /* SkiaKeeper.c */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
|
@ -245,8 +250,6 @@
|
|||
|
||||
/* Begin PBXFileReference section */
|
||||
21C951551C03D27A003A1E1D /* liblibskia_osx.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = liblibskia_osx.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
21C951611C03D2B1003A1E1D /* SkiaKeeper.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SkiaKeeper.c; sourceTree = "<group>"; };
|
||||
21C951621C03D2B1003A1E1D /* SkiaKeeper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SkiaKeeper.h; sourceTree = "<group>"; };
|
||||
21C951661C03D363003A1E1D /* sfnt.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = sfnt.xcodeproj; path = ../../skia/out/gyp/sfnt.xcodeproj; sourceTree = "<group>"; };
|
||||
21C9516C1C03D36D003A1E1D /* core.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = core.xcodeproj; path = ../../skia/out/gyp/core.xcodeproj; sourceTree = "<group>"; };
|
||||
21C951781C03D380003A1E1D /* effects.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = effects.xcodeproj; path = ../../skia/out/gyp/effects.xcodeproj; sourceTree = "<group>"; };
|
||||
|
@ -263,6 +266,13 @@
|
|||
21C951D71C03D4F9003A1E1D /* ktx.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ktx.xcodeproj; path = ../../skia/out/gyp/ktx.xcodeproj; sourceTree = "<group>"; };
|
||||
21C951E01C03D528003A1E1D /* utils.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = utils.xcodeproj; path = ../../skia/out/gyp/utils.xcodeproj; sourceTree = "<group>"; };
|
||||
21C951ED1C03D551003A1E1D /* etc1.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = etc1.xcodeproj; path = ../../skia/out/gyp/etc1.xcodeproj; sourceTree = "<group>"; };
|
||||
340303821C404C3D00630F26 /* sk_xamarin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = sk_xamarin.cpp; path = ../src/sk_xamarin.cpp; sourceTree = "<group>"; };
|
||||
3403038E1C404FD100630F26 /* sk_xamarin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sk_xamarin.h; path = ../src/sk_xamarin.h; sourceTree = "<group>"; };
|
||||
340303981C40543C00630F26 /* sk_managedstream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = sk_managedstream.cpp; path = "/Users/matthew/projects/SkiaSharp/native-builds/libskia_osx/../src/sk_managedstream.cpp"; sourceTree = "<absolute>"; };
|
||||
340303991C40543C00630F26 /* sk_managedstream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sk_managedstream.h; path = "/Users/matthew/projects/SkiaSharp/native-builds/libskia_osx/../src/sk_managedstream.h"; sourceTree = "<absolute>"; };
|
||||
3403039A1C40543C00630F26 /* SkManagedStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkManagedStream.cpp; path = "/Users/matthew/projects/SkiaSharp/gyp/../native-builds/src/SkManagedStream.cpp"; sourceTree = "<absolute>"; };
|
||||
3403039B1C40543C00630F26 /* SkManagedStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkManagedStream.h; path = "/Users/matthew/projects/SkiaSharp/gyp/../native-builds/src/SkManagedStream.h"; sourceTree = "<absolute>"; };
|
||||
343DAE2E1C3F26CF00FAD826 /* SkiaKeeper.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SkiaKeeper.c; path = ../src/SkiaKeeper.c; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
|
@ -298,8 +308,8 @@
|
|||
21C9514C1C03D27A003A1E1D = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
343DAE2D1C3F26BF00FAD826 /* Source */,
|
||||
21C951651C03D2E3003A1E1D /* skia_libs */,
|
||||
21C951571C03D27A003A1E1D /* libskia_osx */,
|
||||
21C951561C03D27A003A1E1D /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
|
@ -312,15 +322,6 @@
|
|||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
21C951571C03D27A003A1E1D /* libskia_osx */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
21C951611C03D2B1003A1E1D /* SkiaKeeper.c */,
|
||||
21C951621C03D2B1003A1E1D /* SkiaKeeper.h */,
|
||||
);
|
||||
path = libskia_osx;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
21C951651C03D2E3003A1E1D /* skia_libs */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
|
@ -431,6 +432,20 @@
|
|||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
343DAE2D1C3F26BF00FAD826 /* Source */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
340303981C40543C00630F26 /* sk_managedstream.cpp */,
|
||||
340303991C40543C00630F26 /* sk_managedstream.h */,
|
||||
3403039A1C40543C00630F26 /* SkManagedStream.cpp */,
|
||||
3403039B1C40543C00630F26 /* SkManagedStream.h */,
|
||||
3403038E1C404FD100630F26 /* sk_xamarin.h */,
|
||||
340303821C404C3D00630F26 /* sk_xamarin.cpp */,
|
||||
343DAE2E1C3F26CF00FAD826 /* SkiaKeeper.c */,
|
||||
);
|
||||
name = Source;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXHeadersBuildPhase section */
|
||||
|
@ -438,7 +453,9 @@
|
|||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
21C951641C03D2B1003A1E1D /* SkiaKeeper.h in Headers */,
|
||||
3403039F1C40543C00630F26 /* SkManagedStream.h in Headers */,
|
||||
3403039D1C40543C00630F26 /* sk_managedstream.h in Headers */,
|
||||
3403038F1C404FD100630F26 /* sk_xamarin.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -675,7 +692,10 @@
|
|||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
21C951631C03D2B1003A1E1D /* SkiaKeeper.c in Sources */,
|
||||
343DAE301C3F26CF00FAD826 /* SkiaKeeper.c in Sources */,
|
||||
340303831C404C3D00630F26 /* sk_xamarin.cpp in Sources */,
|
||||
3403039C1C40543C00630F26 /* sk_managedstream.cpp in Sources */,
|
||||
3403039E1C40543C00630F26 /* SkManagedStream.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -754,7 +774,7 @@
|
|||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
|
@ -772,13 +792,21 @@
|
|||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_C_LANGUAGE_STANDARD = c99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
SK_INTERNAL,
|
||||
SK_GAMMA_SRGB,
|
||||
SK_GAMMA_APPLY_TO_A8,
|
||||
"SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=1",
|
||||
"SK_SUPPORT_GPU=1",
|
||||
"SK_SUPPORT_OPENCL=0",
|
||||
"SK_FORCE_DISTANCE_FIELD_TEXT=0",
|
||||
SK_BUILD_FOR_MAC,
|
||||
"SK_DEVELOPER=1",
|
||||
SKIA_DLL,
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
|
@ -797,7 +825,7 @@
|
|||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
|
@ -815,8 +843,20 @@
|
|||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_C_LANGUAGE_STANDARD = c99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
SK_INTERNAL,
|
||||
SK_GAMMA_SRGB,
|
||||
SK_GAMMA_APPLY_TO_A8,
|
||||
"SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=1",
|
||||
"SK_SUPPORT_GPU=1",
|
||||
"SK_SUPPORT_OPENCL=0",
|
||||
"SK_FORCE_DISTANCE_FIELD_TEXT=0",
|
||||
SK_BUILD_FOR_MAC,
|
||||
NDEBUG,
|
||||
SKIA_DLL,
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
|
@ -835,7 +875,18 @@
|
|||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
HEADER_SEARCH_PATHS = ../../skia/include/c;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
../../skia/src/c,
|
||||
../../skia/include/c,
|
||||
../../skia/include/core,
|
||||
../../skia/include/config,
|
||||
);
|
||||
OTHER_CPLUSPLUSFLAGS = (
|
||||
"-std=c++0x",
|
||||
"-stdlib=libc++",
|
||||
"-fvisibility=hidden",
|
||||
"-fvisibility-inlines-hidden",
|
||||
);
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Debug;
|
||||
|
@ -846,7 +897,18 @@
|
|||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
HEADER_SEARCH_PATHS = ../../skia/include/c;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
../../skia/src/c,
|
||||
../../skia/include/c,
|
||||
../../skia/include/core,
|
||||
../../skia/include/config,
|
||||
);
|
||||
OTHER_CPLUSPLUSFLAGS = (
|
||||
"-std=c++0x",
|
||||
"-stdlib=libc++",
|
||||
"-fvisibility=hidden",
|
||||
"-fvisibility-inlines-hidden",
|
||||
);
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Release;
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
//
|
||||
// SkiaKeeper.c
|
||||
// libskia_osx
|
||||
//
|
||||
// Created by Bill Holmes on 11/23/15.
|
||||
// Copyright © 2015 Xamarin. All rights reserved.
|
||||
//
|
||||
|
||||
#include "SkiaKeeper.h"
|
||||
|
||||
#include "sk_surface.h"
|
||||
#include "sk_paint.h"
|
||||
#include "sk_typeface.h"
|
||||
|
||||
|
||||
|
||||
void** KeepSkiaCSymbols ()
|
||||
{
|
||||
static void* ret[3] = {sk_surface_unref, sk_paint_new, sk_typeface_unref};
|
||||
|
||||
return ret;
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
//
|
||||
// SkiaKeeper.h
|
||||
// libskia_osx
|
||||
//
|
||||
// Created by Bill Holmes on 11/23/15.
|
||||
// Copyright © 2015 Xamarin. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef SkiaKeeper_h
|
||||
#define SkiaKeeper_h
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#endif /* SkiaKeeper_h */
|
|
@ -0,0 +1,94 @@
|
|||
//
|
||||
// SkManagedStream.cpp
|
||||
//
|
||||
// Created by Matthew on 2016/01/08.
|
||||
// Copyright © 2016 Xamarin. All rights reserved.
|
||||
//
|
||||
|
||||
#include "SkManagedStream.h"
|
||||
|
||||
|
||||
static read_delegate fRead = nullptr;
|
||||
static isAtEnd_delegate fIsAtEnd = nullptr;
|
||||
static rewind_delegate fRewind = nullptr;
|
||||
static getPosition_delegate fGetPosition = nullptr;
|
||||
static seek_delegate fSeek = nullptr;
|
||||
static move_delegate fMove = nullptr;
|
||||
static getLength_delegate fGetLength = nullptr;
|
||||
static createNew_delegate fCreateNew = nullptr;
|
||||
static destroy_delegate fDestroy = nullptr;
|
||||
|
||||
|
||||
SkManagedStream::SkManagedStream() {
|
||||
this->address = (size_t)this;
|
||||
}
|
||||
|
||||
SkManagedStream::~SkManagedStream() {
|
||||
fDestroy(address);
|
||||
}
|
||||
|
||||
void SkManagedStream::setDelegates(const read_delegate pRead,
|
||||
const isAtEnd_delegate pIsAtEnd,
|
||||
const rewind_delegate pRewind,
|
||||
const getPosition_delegate pGetPosition,
|
||||
const seek_delegate pSeek,
|
||||
const move_delegate pMove,
|
||||
const getLength_delegate pGetLength,
|
||||
const createNew_delegate pCreateNew,
|
||||
const destroy_delegate pDestroy)
|
||||
{
|
||||
fRead = (pRead);
|
||||
fIsAtEnd = (pIsAtEnd);
|
||||
fRewind = (pRewind);
|
||||
fGetPosition = (pGetPosition);
|
||||
fSeek = (pSeek);
|
||||
fMove = (pMove);
|
||||
fGetLength = (pGetLength);
|
||||
fCreateNew = (pCreateNew);
|
||||
fDestroy = (pDestroy);
|
||||
}
|
||||
|
||||
|
||||
size_t SkManagedStream::read(void* buffer, size_t size) {
|
||||
return fRead(this, buffer, size);
|
||||
}
|
||||
|
||||
bool SkManagedStream::peek(void *buffer, size_t size) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SkManagedStream::isAtEnd() const {
|
||||
return fIsAtEnd(this);
|
||||
}
|
||||
|
||||
bool SkManagedStream::rewind() {
|
||||
return fRewind(this);
|
||||
}
|
||||
|
||||
size_t SkManagedStream::getPosition() const {
|
||||
return fGetPosition(this);
|
||||
}
|
||||
|
||||
bool SkManagedStream::seek(size_t position) {
|
||||
return fSeek(this, position);
|
||||
}
|
||||
|
||||
bool SkManagedStream::move(long offset) {
|
||||
return fMove(this, offset);
|
||||
}
|
||||
|
||||
size_t SkManagedStream::getLength() const {
|
||||
return fGetLength(this);
|
||||
}
|
||||
|
||||
SkManagedStream* SkManagedStream::duplicate() const {
|
||||
return fCreateNew(this);
|
||||
}
|
||||
|
||||
SkManagedStream* SkManagedStream::fork() const {
|
||||
SkAutoTDelete<SkManagedStream> that(fCreateNew(this));
|
||||
that->seek(getPosition());
|
||||
return that.detach();
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
//
|
||||
// SkManagedStream.hpp
|
||||
//
|
||||
// Created by Matthew on 2016/01/08.
|
||||
// Copyright © 2016 Xamarin. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef SkManagedStream_h
|
||||
#define SkManagedStream_h
|
||||
|
||||
#include "SkTypes.h"
|
||||
#include "SkStream.h"
|
||||
|
||||
|
||||
class SkManagedStream;
|
||||
|
||||
// delegate declarations
|
||||
typedef size_t (*read_delegate) (SkManagedStream* managedStream, void* buffer, size_t size);
|
||||
typedef bool (*isAtEnd_delegate) (const SkManagedStream* managedStream);
|
||||
typedef bool (*rewind_delegate) (SkManagedStream* managedStream);
|
||||
typedef size_t (*getPosition_delegate) (const SkManagedStream* managedStream);
|
||||
typedef bool (*seek_delegate) (SkManagedStream* managedStream, size_t position);
|
||||
typedef bool (*move_delegate) (SkManagedStream* managedStream, long offset);
|
||||
typedef size_t (*getLength_delegate) (const SkManagedStream* managedStream);
|
||||
typedef SkManagedStream* (*createNew_delegate) (const SkManagedStream* managedStream);
|
||||
typedef void (*destroy_delegate) (size_t managedStream);
|
||||
|
||||
// managed stream wrapper
|
||||
class SK_API SkManagedStream : public SkStreamAsset {
|
||||
public:
|
||||
SkManagedStream();
|
||||
|
||||
virtual ~SkManagedStream();
|
||||
|
||||
static void setDelegates(const read_delegate pRead,
|
||||
const isAtEnd_delegate pIsAtEnd,
|
||||
const rewind_delegate pRewind,
|
||||
const getPosition_delegate pGetPosition,
|
||||
const seek_delegate pSeek,
|
||||
const move_delegate pMove,
|
||||
const getLength_delegate pGetLength,
|
||||
const createNew_delegate pCreateNew,
|
||||
const destroy_delegate pDestroy);
|
||||
|
||||
size_t read(void* buffer, size_t size) override;
|
||||
bool isAtEnd() const override;
|
||||
|
||||
bool peek(void* buffer, size_t size) const override;
|
||||
|
||||
bool rewind() override;
|
||||
SkManagedStream* duplicate() const override;
|
||||
|
||||
size_t getPosition() const override;
|
||||
bool seek(size_t position) override;
|
||||
bool move(long offset) override;
|
||||
SkManagedStream* fork() const override;
|
||||
|
||||
size_t getLength() const override;
|
||||
|
||||
private:
|
||||
size_t address;
|
||||
|
||||
typedef SkManagedStream INHERITED;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
|
@ -0,0 +1,28 @@
|
|||
//
|
||||
// SkiaKeeper.c
|
||||
//
|
||||
// Created by Bill Holmes on 11/23/15.
|
||||
// Copyright © 2015 Xamarin. All rights reserved.
|
||||
//
|
||||
|
||||
#include "sk_xamarin.h"
|
||||
|
||||
#include "sk_surface.h"
|
||||
#include "sk_paint.h"
|
||||
#include "sk_typeface.h"
|
||||
#include "sk_stream.h"
|
||||
#include "sk_managedstream.h"
|
||||
|
||||
SK_API void** KeepSkiaCSymbols ();
|
||||
|
||||
void** KeepSkiaCSymbols ()
|
||||
{
|
||||
static void* ret[] = {
|
||||
(void*)sk_surface_unref,
|
||||
(void*)sk_paint_new,
|
||||
(void*)sk_typeface_unref,
|
||||
(void*)sk_filestream_new,
|
||||
(void*)sk_managedstream_new,
|
||||
};
|
||||
return ret;
|
||||
}
|
|
@ -0,0 +1,95 @@
|
|||
/*
|
||||
* Copyright 2015 Xamarin Inc.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license that can be
|
||||
* found in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "SkManagedStream.h"
|
||||
|
||||
#include "sk_managedstream.h"
|
||||
#include "sk_types_priv.h"
|
||||
|
||||
|
||||
static sk_managedstream_read_delegate gRead;
|
||||
static sk_managedstream_isAtEnd_delegate gIsAtEnd;
|
||||
static sk_managedstream_rewind_delegate gRewind;
|
||||
static sk_managedstream_getPosition_delegate gGetPosition;
|
||||
static sk_managedstream_seek_delegate gSeek;
|
||||
static sk_managedstream_move_delegate gMove;
|
||||
static sk_managedstream_getLength_delegate gGetLength;
|
||||
static sk_managedstream_createNew_delegate gCreateNew;
|
||||
static sk_managedstream_destroy_delegate gDestroy;
|
||||
|
||||
|
||||
static inline SkManagedStream* AsManagedStream(sk_stream_managedstream_t* cstream) {
|
||||
return reinterpret_cast<SkManagedStream*>(cstream);
|
||||
}
|
||||
|
||||
|
||||
size_t dRead(SkManagedStream* managedStream, void* buffer, size_t size)
|
||||
{
|
||||
return gRead((sk_stream_managedstream_t*)managedStream, buffer, size);
|
||||
}
|
||||
bool dIsAtEnd(const SkManagedStream* managedStream)
|
||||
{
|
||||
return gIsAtEnd((sk_stream_managedstream_t*)managedStream);
|
||||
}
|
||||
bool dRewind(SkManagedStream* managedStream)
|
||||
{
|
||||
return gRewind((sk_stream_managedstream_t*)managedStream);
|
||||
}
|
||||
size_t dGetPosition(const SkManagedStream* managedStream)
|
||||
{
|
||||
return gGetPosition((sk_stream_managedstream_t*)managedStream);
|
||||
}
|
||||
bool dSeek(SkManagedStream* managedStream, size_t position)
|
||||
{
|
||||
return gSeek((sk_stream_managedstream_t*)managedStream, position);
|
||||
}
|
||||
bool dMove(SkManagedStream* managedStream, long offset)
|
||||
{
|
||||
return gMove((sk_stream_managedstream_t*)managedStream, offset);
|
||||
}
|
||||
size_t dGetLength(const SkManagedStream* managedStream)
|
||||
{
|
||||
return gGetLength((sk_stream_managedstream_t*)managedStream);
|
||||
}
|
||||
SkManagedStream* dCreateNew(const SkManagedStream* managedStream)
|
||||
{
|
||||
return AsManagedStream(gCreateNew((sk_stream_managedstream_t*)managedStream));
|
||||
}
|
||||
void dDestroy(size_t managedStream)
|
||||
{
|
||||
gDestroy(managedStream);
|
||||
}
|
||||
|
||||
|
||||
sk_stream_managedstream_t* sk_managedstream_new ()
|
||||
{
|
||||
return (sk_stream_managedstream_t*)new SkManagedStream();
|
||||
}
|
||||
|
||||
void sk_managedstream_set_delegates (const sk_managedstream_read_delegate pRead,
|
||||
const sk_managedstream_isAtEnd_delegate pIsAtEnd,
|
||||
const sk_managedstream_rewind_delegate pRewind,
|
||||
const sk_managedstream_getPosition_delegate pGetPosition,
|
||||
const sk_managedstream_seek_delegate pSeek,
|
||||
const sk_managedstream_move_delegate pMove,
|
||||
const sk_managedstream_getLength_delegate pGetLength,
|
||||
const sk_managedstream_createNew_delegate pCreateNew,
|
||||
const sk_managedstream_destroy_delegate pDestroy)
|
||||
{
|
||||
gRead = pRead;
|
||||
gIsAtEnd = pIsAtEnd;
|
||||
gRewind = pRewind;
|
||||
gGetPosition = pGetPosition;
|
||||
gSeek = pSeek;
|
||||
gMove = pMove;
|
||||
gGetLength = pGetLength;
|
||||
gCreateNew = pCreateNew;
|
||||
gDestroy = pDestroy;
|
||||
|
||||
SkManagedStream::setDelegates(dRead, dIsAtEnd, dRewind, dGetPosition, dSeek, dMove, dGetLength, dCreateNew, dDestroy);
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* Copyright 2015 Xamarin Inc.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license that can be
|
||||
* found in the LICENSE file.
|
||||
*/
|
||||
|
||||
// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
|
||||
// DO NOT USE -- FOR INTERNAL TESTING ONLY
|
||||
|
||||
#ifndef sk_managedstream_DEFINED
|
||||
#define sk_managedstream_DEFINED
|
||||
|
||||
#include "sk_xamarin.h"
|
||||
|
||||
#include "sk_types.h"
|
||||
|
||||
SK_C_PLUS_PLUS_BEGIN_GUARD
|
||||
|
||||
|
||||
typedef struct sk_stream_managedstream_t sk_stream_managedstream_t;
|
||||
|
||||
|
||||
typedef size_t (*sk_managedstream_read_delegate) (sk_stream_managedstream_t* cmanagedStream, void* buffer, size_t size);
|
||||
typedef bool (*sk_managedstream_isAtEnd_delegate) (const sk_stream_managedstream_t* cmanagedStream);
|
||||
typedef bool (*sk_managedstream_rewind_delegate) (sk_stream_managedstream_t* cmanagedStream);
|
||||
typedef size_t (*sk_managedstream_getPosition_delegate) (const sk_stream_managedstream_t* cmanagedStream);
|
||||
typedef bool (*sk_managedstream_seek_delegate) (sk_stream_managedstream_t* cmanagedStream, size_t position);
|
||||
typedef bool (*sk_managedstream_move_delegate) (sk_stream_managedstream_t* cmanagedStream, long offset);
|
||||
typedef size_t (*sk_managedstream_getLength_delegate) (const sk_stream_managedstream_t* cmanagedStream);
|
||||
typedef sk_stream_managedstream_t* (*sk_managedstream_createNew_delegate) (const sk_stream_managedstream_t* cmanagedStream);
|
||||
typedef void (*sk_managedstream_destroy_delegate) (size_t cmanagedStream);
|
||||
|
||||
|
||||
// c API
|
||||
SK_API sk_stream_managedstream_t* sk_managedstream_new ();
|
||||
|
||||
SK_API void sk_managedstream_set_delegates (const sk_managedstream_read_delegate pRead,
|
||||
const sk_managedstream_isAtEnd_delegate pIsAtEnd,
|
||||
const sk_managedstream_rewind_delegate pRewind,
|
||||
const sk_managedstream_getPosition_delegate pGetPosition,
|
||||
const sk_managedstream_seek_delegate pSeek,
|
||||
const sk_managedstream_move_delegate pMove,
|
||||
const sk_managedstream_getLength_delegate pGetLength,
|
||||
const sk_managedstream_createNew_delegate pCreateNew,
|
||||
const sk_managedstream_destroy_delegate pDestroy);
|
||||
|
||||
|
||||
SK_C_PLUS_PLUS_END_GUARD
|
||||
|
||||
#endif
|
|
@ -0,0 +1,11 @@
|
|||
|
||||
#include "sk_xamarin.h"
|
||||
|
||||
|
||||
#ifdef NEED_INIT_NEON
|
||||
|
||||
namespace SkOpts {
|
||||
void Init_neon() {}
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright 2015 Xamarin Inc.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license that can be
|
||||
* found in the LICENSE file.
|
||||
*/
|
||||
|
||||
// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
|
||||
// DO NOT USE -- FOR INTERNAL TESTING ONLY
|
||||
|
||||
|
||||
#if defined(SKIA_DLL)
|
||||
# if defined(WIN32)
|
||||
# if SKIA_IMPLEMENTATION
|
||||
# define SK_API __declspec(dllexport)
|
||||
# else
|
||||
# define SK_API __declspec(dllimport)
|
||||
# endif
|
||||
# else
|
||||
# define SK_API __attribute__((visibility("default")))
|
||||
# endif
|
||||
#else
|
||||
# define SK_API
|
||||
#endif
|
||||
|
2
skia
2
skia
|
@ -1 +1 @@
|
|||
Subproject commit fd370f0131e526963a77eb528819101cdc8eb871
|
||||
Subproject commit 25197e8dfade503939cad4ad875984c7d895fa7c
|
Загрузка…
Ссылка в новой задаче