Sk64 is a 64-bit math package that does not require long long support from the compiler.
*/
-struct Sk64 {
+struct SK_API Sk64 {
int32_t fHi; //!< the high 32 bits of the number (including sign)
uint32_t fLo; //!< the low 32 bits of the number
@param blue blue component value [0..255]
@param hsv 3 element array which holds the resulting HSV components.
*/
-void SkRGBToHSV(U8CPU red, U8CPU green, U8CPU blue, SkScalar hsv[3]);
+SK_API void SkRGBToHSV(U8CPU red, U8CPU green, U8CPU blue, SkScalar hsv[3]);
/** Convert the argb color to its HSV components.
hsv[0] is Hue [0 .. 360)
@param hsv 3 element array which holds the input HSV components.
@return the resulting argb color
*/
-SkColor SkHSVToColor(U8CPU alpha, const SkScalar hsv[3]);
+SK_API SkColor SkHSVToColor(U8CPU alpha, const SkScalar hsv[3]);
/** Convert HSV components to an ARGB color. The alpha component set to 0xFF.
hsv[0] is Hue [0 .. 360)
font scaler (e.g. freetype or other) to the font's data.
5) Utilites to manage the font cache (budgeting) and gamma correction
*/
-class SkFontHost {
+class SK_API SkFontHost {
public:
/** Return a new, closest matching typeface given either an existing family
(specified by a typeface in that family) or by a familyName and a
class SkRefCnt;
-class SkMetaData {
+class SK_API SkMetaData {
public:
/**
* Used to manage the life-cycle of a ptr in the metadata. This is option
#include "SkRefCnt.h"
#include "SkScalar.h"
-class SkStream : public SkRefCnt {
+class SK_API SkStream : public SkRefCnt {
public:
virtual ~SkStream();
/** Called to rewind to the beginning of the stream. If this cannot be
/** Implemented by the porting layer, this function adds 1 to the int specified
by the address (in a thread-safe manner), and returns the previous value.
*/
-int32_t sk_atomic_inc(int32_t* addr);
+SK_API int32_t sk_atomic_inc(int32_t* addr);
/** Implemented by the porting layer, this function subtracts 1 to the int
specified by the address (in a thread-safe manner), and returns the previous
value.
*/
-int32_t sk_atomic_dec(int32_t* addr);
+SK_API int32_t sk_atomic_dec(int32_t* addr);
class SkMutex {
public:
///////////////////////////////////////////////////////////////////////////////
+class SkGPipeControler {
+public:
+ struct Block {
+ void* fAddr;
+ size_t fSize;
+ };
+
+ enum Status {
+ kSuccess_Status,
+ kFailure_Status
+ };
+
+ /**
+ * To record drawing commands, we request blocks from the controller for
+ * subsequent writes, and we want to send/flush blocks of commands we have
+ * already written.
+ *
+ * For each call to handleBlock, the send block will contain the block
+ * (previously returned in a request parameter) that we have written, and
+ * if there is more to be recorded, the request block will receive the
+ * new block of memory to write into. When the writer detects that there
+ * are no more drawing commands expected, it will call handleBlock with
+ * NULL for the request parameter.
+ *
+ * If handleBlock ever returns kFailure_Status, the writer will cease to
+ * call handleBlock.
+ */
+ virtual Status handleBlock(const Block& send, Block* request) = 0;
+};
+
class SkGPipeWriter {
public:
SkGPipeWriter();
~SkGPipeWriter();
bool isRecording() const { return NULL != fCanvas; }
- SkCanvas* startRecording();
+ SkCanvas* startRecording(SkGPipeControler*);
void endRecording();
size_t flatten(void* buffer);
private:
class SkGPipeCanvas* fCanvas;
+ SkGPipeControler* fControler;
SkWriter32 fWriter;
};