class SkPaint;
class SkPicture;
-#ifdef SK_SUPPORT_LEGACY_REFENCODEDDATA_NOCTX
- #define SK_REFENCODEDDATA_CTXPARAM
-#else
- #define SK_REFENCODEDDATA_CTXPARAM GrContext* ctx
-#endif
-
class SK_API SkImageGenerator : public SkNoncopyable {
public:
/**
* unref() on the data when it is finished.
*/
SkData* refEncodedData(GrContext* ctx = nullptr) {
-#ifdef SK_SUPPORT_LEGACY_REFENCODEDDATA_NOCTX
- return this->onRefEncodedData();
-#else
return this->onRefEncodedData(ctx);
-#endif
}
/**
SkImageGenerator(const SkImageInfo& info, uint32_t uniqueId = kNeedNewImageUniqueID);
- virtual SkData* onRefEncodedData(SK_REFENCODEDDATA_CTXPARAM);
+ virtual SkData* onRefEncodedData(GrContext* ctx);
virtual bool onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes,
SkPMColor ctable[], int* ctableCount);
, fData(std::move(data))
{}
-SkData* SkCodecImageGenerator::onRefEncodedData(SK_REFENCODEDDATA_CTXPARAM) {
+SkData* SkCodecImageGenerator::onRefEncodedData(GrContext* ctx) {
return SkRef(fData.get());
}
}
protected:
- SkData* onRefEncodedData(SK_REFENCODEDDATA_CTXPARAM) override;
+ SkData* onRefEncodedData(GrContext* ctx) override;
bool onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes, SkPMColor ctable[],
int* ctableCount) override;
/////////////////////////////////////////////////////////////////////////////////////////////
-SkData* SkImageGenerator::onRefEncodedData(SK_REFENCODEDDATA_CTXPARAM) {
+SkData* SkImageGenerator::onRefEncodedData(GrContext* ctx) {
return nullptr;
}
, fData(SkRef(data))
{}
-SkData* SkImageGeneratorCG::onRefEncodedData(SK_REFENCODEDDATA_CTXPARAM) {
+SkData* SkImageGeneratorCG::onRefEncodedData(GrContext* ctx) {
return SkRef(fData.get());
}
static SkImageGenerator* NewFromEncodedCG(SkData* data);
protected:
- SkData* onRefEncodedData(SK_REFENCODEDDATA_CTXPARAM) override;
+ SkData* onRefEncodedData(GrContext* ctx) override;
bool onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes, SkPMColor ctable[],
int* ctableCount) override;
, fData(SkRef(data))
{}
-SkData* SkImageGeneratorWIC::onRefEncodedData(SK_REFENCODEDDATA_CTXPARAM) {
+SkData* SkImageGeneratorWIC::onRefEncodedData(GrContext* ctx) {
return SkRef(fData.get());
}
static SkImageGenerator* NewFromEncodedWIC(SkData* data);
protected:
- SkData* onRefEncodedData(SK_REFENCODEDDATA_CTXPARAM) override;
+ SkData* onRefEncodedData(GrContext* ctx) override;
bool onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes, SkPMColor ctable[],
int* ctableCount) override;