Add SK_API to APIs used by the android framework.

This CL enables us to set the default visibility of the symbols
on Android to hidden.  It is the intent that all of he SK_APIs
that have been added to /src directies should be removed as soon
as we can remove their callers within Android.

Bug: b/31971097
Change-Id: Ic787f94df0fb0c2b8d941aa7095a12b317c4b5de
Reviewed-on: https://skia-review.googlesource.com/49501
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
This commit is contained in:
Derek Sollenberger 2017-09-20 15:51:08 -04:00 committed by Skia Commit-Bot
parent f4b9bf7d9e
commit 2fbf1bc8c9
19 changed files with 24 additions and 24 deletions

View File

@ -17,7 +17,7 @@
* This class aims to provide an interface to test multiple implementations of * This class aims to provide an interface to test multiple implementations of
* SkBitmapRegionDecoder. * SkBitmapRegionDecoder.
*/ */
class SkBitmapRegionDecoder { class SK_API SkBitmapRegionDecoder {
public: public:
enum Strategy { enum Strategy {

View File

@ -17,7 +17,7 @@
* Abstract interface defining image codec functionality that is necessary for * Abstract interface defining image codec functionality that is necessary for
* Android. * Android.
*/ */
class SkAndroidCodec : SkNoncopyable { class SK_API SkAndroidCodec : SkNoncopyable {
public: public:
/** /**
* If this stream represents an encoded image that we know how to decode, * If this stream represents an encoded image that we know how to decode,

View File

@ -175,7 +175,7 @@ struct SkPM4f;
/* /*
* The float values are 0...1 unpremultiplied * The float values are 0...1 unpremultiplied
*/ */
struct SkColor4f { struct SK_API SkColor4f {
float fR; float fR;
float fG; float fG;
float fB; float fB;

View File

@ -23,7 +23,7 @@ struct SkRect;
* allow for clients of the drawable that may want to cache the results, the drawable must * allow for clients of the drawable that may want to cache the results, the drawable must
* change its generation ID whenever its internal state changes such that it will draw differently. * change its generation ID whenever its internal state changes such that it will draw differently.
*/ */
class SkDrawable : public SkFlattenable { class SK_API SkDrawable : public SkFlattenable {
public: public:
SkDrawable(); SkDrawable();

View File

@ -17,7 +17,7 @@
/** /**
* An immutable set of vertex data that can be used with SkCanvas::drawVertices. * An immutable set of vertex data that can be used with SkCanvas::drawVertices.
*/ */
class SkVertices : public SkNVRefCnt<SkVertices> { class SK_API SkVertices : public SkNVRefCnt<SkVertices> {
public: public:
enum VertexMode { enum VertexMode {
kTriangles_VertexMode, kTriangles_VertexMode,

View File

@ -16,7 +16,7 @@
* its original position. * its original position.
*/ */
namespace SkBlurDrawLooper { namespace SkBlurDrawLooper {
sk_sp<SkDrawLooper> Make(SkColor color, SkScalar sigma, SkScalar dx, SkScalar dy); sk_sp<SkDrawLooper> SK_API Make(SkColor color, SkScalar sigma, SkScalar dx, SkScalar dy);
}; };
#endif #endif

View File

@ -115,7 +115,7 @@ private:
void doUpdate() const; void doUpdate() const;
}; };
class Sk3DView : SkNoncopyable { class SK_API Sk3DView : SkNoncopyable {
public: public:
Sk3DView(); Sk3DView();
~Sk3DView(); ~Sk3DView();

View File

@ -19,7 +19,7 @@
* X bytes (inclusive), and the wrapped stream is not necessarily * X bytes (inclusive), and the wrapped stream is not necessarily
* able to rewind at all. * able to rewind at all.
*/ */
class SkFrontBufferedStream { class SK_API SkFrontBufferedStream {
public: public:
/** /**
* Creates a new stream that wraps and buffers an SkStream. * Creates a new stream that wraps and buffers an SkStream.

View File

@ -12,7 +12,7 @@
#include "SkScalar.h" #include "SkScalar.h"
class SkInterpolatorBase : SkNoncopyable { class SK_API SkInterpolatorBase : SkNoncopyable {
public: public:
enum Result { enum Result {
kNormal_Result, kNormal_Result,
@ -84,7 +84,7 @@ protected:
#endif #endif
}; };
class SkInterpolator : public SkInterpolatorBase { class SK_API SkInterpolator : public SkInterpolatorBase {
public: public:
SkInterpolator(); SkInterpolator();
SkInterpolator(int elemCount, int frameCount); SkInterpolator(int elemCount, int frameCount);

View File

@ -17,7 +17,7 @@ class SkCanvas;
class SkPath; class SkPath;
class SkResourceCache; class SkResourceCache;
class SkShadowUtils { class SK_API SkShadowUtils {
public: public:
/** /**
* Draw an offset spot shadow and outlining ambient shadow for the given path using a disc * Draw an offset spot shadow and outlining ambient shadow for the given path using a disc

View File

@ -183,8 +183,8 @@ static inline SkPMColor16 SkDitherARGB32To4444(SkPMColor c, unsigned dither)
#define DITHER_VALUE(x) dither_scan[(x) & 3] #define DITHER_VALUE(x) dither_scan[(x) & 3]
#else #else
extern const uint16_t gDitherMatrix_4Bit_16[4]; extern SK_API const uint16_t gDitherMatrix_4Bit_16[4];
extern const uint16_t gDitherMatrix_3Bit_16[4]; extern SK_API const uint16_t gDitherMatrix_3Bit_16[4];
#define DITHER_4444_SCAN(y) const uint16_t dither_scan = gDitherMatrix_4Bit_16[(y) & 3] #define DITHER_4444_SCAN(y) const uint16_t dither_scan = gDitherMatrix_4Bit_16[(y) & 3]
#define DITHER_565_SCAN(y) const uint16_t dither_scan = gDitherMatrix_3Bit_16[(y) & 3] #define DITHER_565_SCAN(y) const uint16_t dither_scan = gDitherMatrix_3Bit_16[(y) & 3]

View File

@ -258,13 +258,13 @@ struct SkConic {
* return the power-of-2 number of quads needed to approximate this conic * return the power-of-2 number of quads needed to approximate this conic
* with a sequence of quads. Will be >= 0. * with a sequence of quads. Will be >= 0.
*/ */
int computeQuadPOW2(SkScalar tol) const; int SK_API computeQuadPOW2(SkScalar tol) const;
/** /**
* Chop this conic into N quads, stored continguously in pts[], where * Chop this conic into N quads, stored continguously in pts[], where
* N = 1 << pow2. The amount of storage needed is (1 + 2 * N) * N = 1 << pow2. The amount of storage needed is (1 + 2 * N)
*/ */
int SK_WARN_UNUSED_RESULT chopIntoQuadsPOW2(SkPoint pts[], int pow2) const; int SK_API SK_WARN_UNUSED_RESULT chopIntoQuadsPOW2(SkPoint pts[], int pow2) const;
bool findXExtrema(SkScalar* t) const; bool findXExtrema(SkScalar* t) const;
bool findYExtrema(SkScalar* t) const; bool findYExtrema(SkScalar* t) const;

View File

@ -23,7 +23,7 @@ static constexpr uint16_t SK_Half1 = 0x3C00; // 1
// convert between half and single precision floating point // convert between half and single precision floating point
float SkHalfToFloat(SkHalf h); float SkHalfToFloat(SkHalf h);
SkHalf SkFloatToHalf(float f); SkHalf SK_API SkFloatToHalf(float f);
// Convert between half and single precision floating point, // Convert between half and single precision floating point,
// assuming inputs and outputs are both finite, and may // assuming inputs and outputs are both finite, and may

View File

@ -43,7 +43,7 @@ sk_sp<SkShader> SkMakeBitmapShader(const SkBitmap& src, SkShader::TileMode, SkSh
* SkImageInfo, or the bitmap's pixels cannot be accessed, this will return * SkImageInfo, or the bitmap's pixels cannot be accessed, this will return
* nullptr. * nullptr.
*/ */
extern sk_sp<SkImage> SkMakeImageFromRasterBitmap(const SkBitmap&, SkCopyPixelsMode); extern SK_API sk_sp<SkImage> SkMakeImageFromRasterBitmap(const SkBitmap&, SkCopyPixelsMode);
/** /**
* Similar to SkMakeImageFromRasterBitmap, this wraps a |src| bitmap in an image. * Similar to SkMakeImageFromRasterBitmap, this wraps a |src| bitmap in an image.

View File

@ -18,7 +18,7 @@ struct SkRect;
/** /**
* Disect a lattice request into an sequence of src-rect / dst-rect pairs * Disect a lattice request into an sequence of src-rect / dst-rect pairs
*/ */
class SkLatticeIter { class SK_API SkLatticeIter {
public: public:
static bool Valid(int imageWidth, int imageHeight, const SkCanvas::Lattice& lattice); static bool Valid(int imageWidth, int imageHeight, const SkCanvas::Lattice& lattice);

View File

@ -49,7 +49,7 @@ namespace SkOpts {
inverted_CMYK_to_BGR1; // i.e. convert color space inverted_CMYK_to_BGR1; // i.e. convert color space
extern void (*memset16)(uint16_t[], uint16_t, int); extern void (*memset16)(uint16_t[], uint16_t, int);
extern void (*memset32)(uint32_t[], uint32_t, int); extern void SK_API (*memset32)(uint32_t[], uint32_t, int);
extern void (*memset64)(uint64_t[], uint64_t, int); extern void (*memset64)(uint64_t[], uint64_t, int);
// The fastest high quality 32-bit hash we can provide on this platform. // The fastest high quality 32-bit hash we can provide on this platform.

View File

@ -26,7 +26,7 @@ static inline Sk4f swizzle_rb_if_bgra(const Sk4f& x) {
/* /*
* The float values are 0...1 premultiplied in RGBA order (regardless of SkPMColor order) * The float values are 0...1 premultiplied in RGBA order (regardless of SkPMColor order)
*/ */
struct SkPM4f { struct SK_API SkPM4f {
enum { enum {
R, G, B, A, R, G, B, A,
}; };

View File

@ -47,9 +47,9 @@ public:
SkBlurStyle, SkIPoint* margin = nullptr); SkBlurStyle, SkIPoint* margin = nullptr);
// If radius > 0, return the corresponding sigma, else return 0 // If radius > 0, return the corresponding sigma, else return 0
static SkScalar ConvertRadiusToSigma(SkScalar radius); static SkScalar SK_API ConvertRadiusToSigma(SkScalar radius);
// If sigma > 0.5, return the corresponding radius, else return 0 // If sigma > 0.5, return the corresponding radius, else return 0
static SkScalar ConvertSigmaToRadius(SkScalar sigma); static SkScalar SK_API ConvertSigmaToRadius(SkScalar sigma);
/* Helper functions for analytic rectangle blurs */ /* Helper functions for analytic rectangle blurs */

View File

@ -19,13 +19,13 @@ extern "C" {
#include <setjmp.h> #include <setjmp.h>
void skjpeg_error_exit(j_common_ptr cinfo); void SK_API skjpeg_error_exit(j_common_ptr cinfo);
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
/* Our destination struct for directing decompressed pixels to our stream /* Our destination struct for directing decompressed pixels to our stream
* object. * object.
*/ */
struct skjpeg_destination_mgr : jpeg_destination_mgr { struct SK_API skjpeg_destination_mgr : jpeg_destination_mgr {
skjpeg_destination_mgr(SkWStream* stream); skjpeg_destination_mgr(SkWStream* stream);
SkWStream* fStream; SkWStream* fStream;