diff options
Diffstat (limited to 'include')
32 files changed, 64 insertions, 48 deletions
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h index 1d21a2f994..349489ed90 100644 --- a/include/core/SkBitmap.h +++ b/include/core/SkBitmap.h @@ -40,7 +40,7 @@ class SkGpuTexture; Bitmaps can be drawn into a SkCanvas, but they are also used to specify the target of a SkCanvas' drawing operations. */ -class SkBitmap { +class SK_API SkBitmap { public: class Allocator; diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h index 5aecacb817..0a1b393c27 100644 --- a/include/core/SkCanvas.h +++ b/include/core/SkCanvas.h @@ -51,7 +51,7 @@ class SkShape; color, typeface, textSize, strokeWidth, shader (e.g. gradients, patterns), etc. */ -class SkCanvas : public SkRefCnt { +class SK_API SkCanvas : public SkRefCnt { public: /** Construct a canvas with the given device factory. @param factory Specify the factory for generating additional devices. @@ -758,7 +758,7 @@ public: call made on the canvas. Ownership of all pointers in the iterator stays with the canvas, so none of them should be modified or deleted. */ - class LayerIter /*: SkNoncopyable*/ { + class SK_API LayerIter /*: SkNoncopyable*/ { public: /** Initialize iterator with canvas, and set values for 1st device */ LayerIter(SkCanvas*, bool skipEmptyClips); diff --git a/include/core/SkClipStack.h b/include/core/SkClipStack.h index db42e4df26..850a3f0983 100644 --- a/include/core/SkClipStack.h +++ b/include/core/SkClipStack.h @@ -7,7 +7,7 @@ struct SkRect; class SkPath; -class SkClipStack { +class SK_API SkClipStack { public: SkClipStack(); ~SkClipStack() {} diff --git a/include/core/SkColor.h b/include/core/SkColor.h index c17068f4d8..6b86e7e08e 100644 --- a/include/core/SkColor.h +++ b/include/core/SkColor.h @@ -152,12 +152,12 @@ typedef uint32_t SkPMColor; /** Return a SkPMColor value from unpremultiplied 8 bit component values */ -SkPMColor SkPreMultiplyARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b); +SK_API SkPMColor SkPreMultiplyARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b); /** Return a SkPMColor value from a SkColor value. This is done by multiplying the color components by the color's alpha, and by arranging the bytes in a configuration dependent order, to match the format of kARGB32 bitmaps. */ -SkPMColor SkPreMultiplyColor(SkColor c); +SK_API SkPMColor SkPreMultiplyColor(SkColor c); /** Define a function pointer type for combining two premultiplied colors */ diff --git a/include/core/SkColorPriv.h b/include/core/SkColorPriv.h index bd407dab22..f9e02a29c7 100644 --- a/include/core/SkColorPriv.h +++ b/include/core/SkColorPriv.h @@ -234,7 +234,7 @@ static inline SkPMColor SkPackARGB32NoCheck(U8CPU a, U8CPU r, U8CPU g, U8CPU b) (g << SK_G32_SHIFT) | (b << SK_B32_SHIFT); } -extern const uint32_t gMask_00FF00FF; +SK_API extern const uint32_t gMask_00FF00FF; static inline uint32_t SkAlphaMulQ(uint32_t c, unsigned scale) { uint32_t mask = gMask_00FF00FF; diff --git a/include/core/SkColorShader.h b/include/core/SkColorShader.h index f7251ff8a4..b7537e127b 100644 --- a/include/core/SkColorShader.h +++ b/include/core/SkColorShader.h @@ -24,7 +24,7 @@ accomplished by just using the color field on the paint, but if an actual shader object is needed, this provides that feature. */ -class SkColorShader : public SkShader { +class SK_API SkColorShader : public SkShader { public: /** Create a ColorShader that will inherit its color from the Paint at draw time. diff --git a/include/core/SkDeque.h b/include/core/SkDeque.h index 92d515300a..8bf8b5b2c2 100644 --- a/include/core/SkDeque.h +++ b/include/core/SkDeque.h @@ -19,7 +19,7 @@ #include "SkTypes.h" -class SkDeque : SkNoncopyable { +class SK_API SkDeque : SkNoncopyable { public: explicit SkDeque(size_t elemSize); SkDeque(size_t elemSize, void* storage, size_t storageSize); diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h index 7332ba7b4e..2f950154eb 100644 --- a/include/core/SkDevice.h +++ b/include/core/SkDevice.h @@ -49,7 +49,7 @@ public: int height, bool isOpaque, bool isLayer); }; -class SkDevice : public SkRefCnt { +class SK_API SkDevice : public SkRefCnt { public: SkDevice(SkCanvas*); /** Construct a new device, extracting the width/height/config/isOpaque values from diff --git a/include/core/SkDrawLooper.h b/include/core/SkDrawLooper.h index 333fb41105..87eb5cbdc0 100644 --- a/include/core/SkDrawLooper.h +++ b/include/core/SkDrawLooper.h @@ -32,7 +32,7 @@ class SkPaint; invoked multiple times (hence the name loop-er), allow it to perform effects like shadows or frame/fills, that require more than one pass. */ -class SkDrawLooper : public SkFlattenable { +class SK_API SkDrawLooper : public SkFlattenable { public: /** Called right before something is being drawn to the specified canvas with the specified paint. Subclass that want to modify either parameter diff --git a/include/core/SkFlattenable.h b/include/core/SkFlattenable.h index 6958462033..ad4062fa9a 100644 --- a/include/core/SkFlattenable.h +++ b/include/core/SkFlattenable.h @@ -33,7 +33,7 @@ class SkString; into a data stream for either transport or as part of the key to the font cache. */ -class SkFlattenable : public SkRefCnt { +class SK_API SkFlattenable : public SkRefCnt { public: typedef SkFlattenable* (*Factory)(SkFlattenableReadBuffer&); diff --git a/include/core/SkFloatBits.h b/include/core/SkFloatBits.h index 1628f6e753..288f2d8238 100644 --- a/include/core/SkFloatBits.h +++ b/include/core/SkFloatBits.h @@ -51,17 +51,17 @@ int32_t SkFloatBits_toIntCast(int32_t floatBits); /** Given the bit representation of a float, return its floor as an int. If the value is out of range, or NaN, return return +/- SK_MaxS32 */ -int32_t SkFloatBits_toIntFloor(int32_t floatBits); +SK_API int32_t SkFloatBits_toIntFloor(int32_t floatBits); /** Given the bit representation of a float, return it rounded to an int. If the value is out of range, or NaN, return return +/- SK_MaxS32 */ -int32_t SkFloatBits_toIntRound(int32_t floatBits); +SK_API int32_t SkFloatBits_toIntRound(int32_t floatBits); /** Given the bit representation of a float, return its ceiling as an int. If the value is out of range, or NaN, return return +/- SK_MaxS32 */ -int32_t SkFloatBits_toIntCeil(int32_t floatBits); +SK_API int32_t SkFloatBits_toIntCeil(int32_t floatBits); #ifdef SK_CAN_USE_FLOAT diff --git a/include/core/SkGeometry.h b/include/core/SkGeometry.h index a20978326d..d4b13fb5df 100644 --- a/include/core/SkGeometry.h +++ b/include/core/SkGeometry.h @@ -90,7 +90,7 @@ int SkChopQuadAtMaxCurvature(const SkPoint src[3], SkPoint dst[5]); convert it into the cubic fitting the same curve. The new cubic curve is returned in dst[0..3]. */ -void SkConvertQuadToCubic(const SkPoint src[3], SkPoint dst[4]); +SK_API void SkConvertQuadToCubic(const SkPoint src[3], SkPoint dst[4]); //////////////////////////////////////////////////////////////////////////////////////// diff --git a/include/core/SkMatrix.h b/include/core/SkMatrix.h index 5c82d78614..5ba9223058 100644 --- a/include/core/SkMatrix.h +++ b/include/core/SkMatrix.h @@ -28,7 +28,7 @@ class SkString; using either reset() - to construct an identity matrix, or one of the set functions (e.g. setTranslate, setRotate, etc.). */ -class SkMatrix { +class SK_API SkMatrix { public: /** Enum of bit fields for the mask return by getType(). Use this to identify the complexity of the matrix. diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h index a4def5f188..4a20dd2621 100644 --- a/include/core/SkPaint.h +++ b/include/core/SkPaint.h @@ -48,7 +48,7 @@ typedef const SkGlyph& (*SkMeasureCacheProc)(SkGlyphCache*, const char**); The SkPaint class holds the style and color information about how to draw geometries, text and bitmaps. */ -class SkPaint { +class SK_API SkPaint { public: SkPaint(); SkPaint(const SkPaint& paint); @@ -56,7 +56,7 @@ public: SkPaint& operator=(const SkPaint&); - friend int operator==(const SkPaint& a, const SkPaint& b); + SK_API friend int operator==(const SkPaint& a, const SkPaint& b); friend int operator!=(const SkPaint& a, const SkPaint& b) { return !(a == b); diff --git a/include/core/SkPath.h b/include/core/SkPath.h index 3afea09433..34f30b10c4 100644 --- a/include/core/SkPath.h +++ b/include/core/SkPath.h @@ -30,7 +30,7 @@ class SkString; The SkPath class encapsulates compound (multiple contour) geometric paths consisting of straight line segments, quadratic curves, and cubic curves. */ -class SkPath { +class SK_API SkPath { public: SkPath(); SkPath(const SkPath&); @@ -514,7 +514,7 @@ public: /** Iterate through all of the segments (lines, quadratics, cubics) of each contours in a path. */ - class Iter { + class SK_API Iter { public: Iter(); Iter(const SkPath&, bool forceClose); diff --git a/include/core/SkPathEffect.h b/include/core/SkPathEffect.h index f97adb7904..eb1cc23833 100644 --- a/include/core/SkPathEffect.h +++ b/include/core/SkPathEffect.h @@ -29,7 +29,7 @@ class SkPath; Dashing is implemented as a subclass of SkPathEffect. */ -class SkPathEffect : public SkFlattenable { +class SK_API SkPathEffect : public SkFlattenable { public: // This method is not exported to java. SkPathEffect() {} diff --git a/include/core/SkPoint.h b/include/core/SkPoint.h index 79ca58c4ea..c89f08003a 100644 --- a/include/core/SkPoint.h +++ b/include/core/SkPoint.h @@ -140,7 +140,7 @@ struct SkIPoint { } }; -struct SkPoint { +struct SK_API SkPoint { SkScalar fX, fY; static SkPoint Make(SkScalar x, SkScalar y) { diff --git a/include/core/SkPreConfig.h b/include/core/SkPreConfig.h index f907578c78..daf2041b4f 100644 --- a/include/core/SkPreConfig.h +++ b/include/core/SkPreConfig.h @@ -96,5 +96,21 @@ #define SK_CPU_HAS_CONDITIONAL_INSTR #endif +////////////////////////////////////////////////////////////////////// + +#if !defined(SKIA_IMPLEMENTATION) + #define SKIA_IMPLEMENTATION 0 +#endif + +#if defined(WIN32) && defined(SKIA_DLL) + #if SKIA_IMPLEMENTATION + #define SK_API __declspec(dllexport) + #else + #define SK_API __declspec(dllimport) + #endif +#else + #define SK_API +#endif + #endif diff --git a/include/core/SkRect.h b/include/core/SkRect.h index 114d1f990c..53c61eaebd 100644 --- a/include/core/SkRect.h +++ b/include/core/SkRect.h @@ -24,7 +24,7 @@ SkIRect holds four 32 bit integer coordinates for a rectangle */ -struct SkIRect { +struct SK_API SkIRect { int32_t fLeft, fTop, fRight, fBottom; static SkIRect MakeEmpty() { @@ -267,7 +267,7 @@ struct SkIRect { /** \struct SkRect */ -struct SkRect { +struct SK_API SkRect { SkScalar fLeft, fTop, fRight, fBottom; static SkRect MakeEmpty() { diff --git a/include/core/SkRefCnt.h b/include/core/SkRefCnt.h index b9b2c9858b..36f4249f21 100644 --- a/include/core/SkRefCnt.h +++ b/include/core/SkRefCnt.h @@ -29,7 +29,7 @@ explicitly (or via the object going out of scope on the stack or calling delete) if getRefCnt() > 1. */ -class SkRefCnt : SkNoncopyable { +class SK_API SkRefCnt : SkNoncopyable { public: /** Default construct, initializing the reference count to 1. */ diff --git a/include/core/SkRefDict.h b/include/core/SkRefDict.h index 3ee27d91b0..0c4b02507d 100644 --- a/include/core/SkRefDict.h +++ b/include/core/SkRefDict.h @@ -23,7 +23,7 @@ * A dictionary of string,refcnt pairs. The dictionary is also an owner of the * refcnt objects while they are contained. */ -class SkRefDict : SkNoncopyable { +class SK_API SkRefDict : SkNoncopyable { public: SkRefDict(); ~SkRefDict(); diff --git a/include/core/SkRegion.h b/include/core/SkRegion.h index 7ddf0875c3..4cda2cd044 100644 --- a/include/core/SkRegion.h +++ b/include/core/SkRegion.h @@ -34,7 +34,7 @@ namespace android { The SkRegion class encapsulates the geometric region used to specify clipping areas for drawing. */ -class SkRegion { +class SK_API SkRegion { public: typedef int32_t RunType; enum { @@ -258,7 +258,7 @@ public: /** Returns the sequence of rectangles, sorted in Y and X, that make up this region. */ - class Iterator { + class SK_API Iterator { public: Iterator() : fRgn(NULL), fDone(true) {} Iterator(const SkRegion&); @@ -281,7 +281,7 @@ public: /** Returns the sequence of rectangles, sorted in Y and X, that make up this region intersected with the specified clip rectangle. */ - class Cliperator { + class SK_API Cliperator { public: Cliperator(const SkRegion&, const SkIRect& clip); bool done() { return fDone; } diff --git a/include/core/SkShader.h b/include/core/SkShader.h index c59cc59029..d837284325 100644 --- a/include/core/SkShader.h +++ b/include/core/SkShader.h @@ -32,7 +32,7 @@ class SkPath; any object (other than a bitmap) that is drawn with that paint will get its color(s) from the shader. */ -class SkShader : public SkFlattenable { +class SK_API SkShader : public SkFlattenable { public: SkShader(); virtual ~SkShader(); diff --git a/include/core/SkTDArray.h b/include/core/SkTDArray.h index 954bcf899d..c64d773b07 100644 --- a/include/core/SkTDArray.h +++ b/include/core/SkTDArray.h @@ -19,7 +19,7 @@ #include "SkTypes.h" -template <typename T> class SkTDArray { +template <typename T> class SK_API SkTDArray { public: SkTDArray() { fReserve = fCount = 0; diff --git a/include/core/SkTypeface.h b/include/core/SkTypeface.h index f4b950768b..c3b0f50d18 100644 --- a/include/core/SkTypeface.h +++ b/include/core/SkTypeface.h @@ -32,7 +32,7 @@ class SkWStream; Typeface objects are immutable, and so they can be shared between threads. */ -class SkTypeface : public SkRefCnt { +class SK_API SkTypeface : public SkRefCnt { public: /** Style specifies the intrinsic style attributes of a given typeface */ diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h index 93f054e4ac..1290935dee 100644 --- a/include/core/SkTypes.h +++ b/include/core/SkTypes.h @@ -59,7 +59,7 @@ enum { return null (if SK_MALLOC_TEMP bit is clear) or call sk_throw() (if SK_MALLOC_TEMP bit is set). To free the memory, call sk_free(). */ -extern void* sk_malloc_flags(size_t size, unsigned flags); +SK_API extern void* sk_malloc_flags(size_t size, unsigned flags); /** Same as sk_malloc(), but hard coded to pass SK_MALLOC_THROW as the flag */ extern void* sk_malloc_throw(size_t size); @@ -69,7 +69,7 @@ extern void* sk_malloc_throw(size_t size); extern void* sk_realloc_throw(void* buffer, size_t size); /** Free memory returned by sk_malloc(). It is safe to pass null. */ -extern void sk_free(void*); +SK_API extern void sk_free(void*); // bzero is safer than memset, but we can't rely on it, so... sk_bzero() static inline void sk_bzero(void* buffer, size_t size) { @@ -152,12 +152,12 @@ typedef int SkBool; typedef uint8_t SkBool8; #ifdef SK_DEBUG - int8_t SkToS8(long); - uint8_t SkToU8(size_t); - int16_t SkToS16(long); - uint16_t SkToU16(size_t); - int32_t SkToS32(long); - uint32_t SkToU32(size_t); + SK_API int8_t SkToS8(long); + SK_API uint8_t SkToU8(size_t); + SK_API int16_t SkToS16(long); + SK_API uint16_t SkToU16(size_t); + SK_API int32_t SkToS32(long); + SK_API uint32_t SkToU32(size_t); #else #define SkToS8(x) ((int8_t)(x)) #define SkToU8(x) ((uint8_t)(x)) @@ -337,7 +337,7 @@ template <typename Dst> Dst SkTCast(const void* ptr) { SkNoncopyable is the base class for objects that may do not want to be copied. It hides its copy-constructor and its assignment-operator. */ -class SkNoncopyable { +class SK_API SkNoncopyable { public: SkNoncopyable() {} diff --git a/include/core/SkUnPreMultiply.h b/include/core/SkUnPreMultiply.h index 4bdb9802e0..44ea50e2f2 100644 --- a/include/core/SkUnPreMultiply.h +++ b/include/core/SkUnPreMultiply.h @@ -22,7 +22,7 @@ #include "SkColor.h" -class SkUnPreMultiply { +class SK_API SkUnPreMultiply { public: typedef uint32_t Scale; diff --git a/include/core/SkXfermode.h b/include/core/SkXfermode.h index 948d1dde1d..155d3f853c 100644 --- a/include/core/SkXfermode.h +++ b/include/core/SkXfermode.h @@ -28,7 +28,7 @@ specified in the Modes enum. When an SkXfermode is assigned to an SkPaint, then objects drawn with that paint have the xfermode applied. */ -class SkXfermode : public SkFlattenable { +class SK_API SkXfermode : public SkFlattenable { public: SkXfermode() {} diff --git a/include/effects/SkBlurDrawLooper.h b/include/effects/SkBlurDrawLooper.h index e7af5c2da1..101d24ebb4 100644 --- a/include/effects/SkBlurDrawLooper.h +++ b/include/effects/SkBlurDrawLooper.h @@ -28,7 +28,7 @@ class SkColorFilter; the original object in its original position. should there be an option to just draw the shadow/blur layer? webkit? */ -class SkBlurDrawLooper : public SkDrawLooper { +class SK_API SkBlurDrawLooper : public SkDrawLooper { public: enum BlurFlags { kNone_BlurFlag = 0x00, diff --git a/include/effects/SkCornerPathEffect.h b/include/effects/SkCornerPathEffect.h index a459478cd9..823de3f6a3 100644 --- a/include/effects/SkCornerPathEffect.h +++ b/include/effects/SkCornerPathEffect.h @@ -24,7 +24,7 @@ SkCornerPathEffect is a subclass of SkPathEffect that can turn sharp corners into various treatments (e.g. rounded corners) */ -class SkCornerPathEffect : public SkPathEffect { +class SK_API SkCornerPathEffect : public SkPathEffect { public: /** radius must be > 0 to have an effect. It specifies the distance from each corner that should be "rounded". diff --git a/include/effects/SkDashPathEffect.h b/include/effects/SkDashPathEffect.h index cc414e305e..145f67d592 100644 --- a/include/effects/SkDashPathEffect.h +++ b/include/effects/SkDashPathEffect.h @@ -23,7 +23,7 @@ SkDashPathEffect is a subclass of SkPathEffect that implements dashing */ -class SkDashPathEffect : public SkPathEffect { +class SK_API SkDashPathEffect : public SkPathEffect { public: /** The intervals array must contain an even number of entries (>=2), with the even indices specifying the "on" intervals, and the odd indices specifying the "off" diff --git a/include/effects/SkGradientShader.h b/include/effects/SkGradientShader.h index c800c6621c..5623be4335 100644 --- a/include/effects/SkGradientShader.h +++ b/include/effects/SkGradientShader.h @@ -26,7 +26,7 @@ class SkUnitMapper; SkGradientShader hosts factories for creating subclasses of SkShader that render linear and radial gradients. */ -class SkGradientShader { +class SK_API SkGradientShader { public: /** Returns a shader that generates a linear gradient between the two specified points. |