Cleanup SkImageGenerator, add missing fns to GrBackendTextureImageGenerator

No "real" API changes.
TBR=reed@google.com

Bug: skia:
Change-Id: I08c29f76806388394938f204f2a50b2fd6ea8942
Reviewed-on: https://skia-review.googlesource.com/16662
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This commit is contained in:
Brian Osman 2017-05-12 09:46:56 -04:00 committed by Skia Commit-Bot
parent b1d3b2e1df
commit 07454223d6
4 changed files with 9 additions and 43 deletions

View File

@ -169,19 +169,14 @@ protected:
SkImageGenerator(const SkImageInfo& info, uint32_t uniqueId = kNeedNewImageUniqueID);
virtual SkData* onRefEncodedData();
virtual SkData* onRefEncodedData() { return nullptr; }
virtual bool onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes,
SkPMColor ctable[], int* ctableCount);
virtual bool onGetPixels(const SkImageInfo&, void*, size_t, SkPMColor[], int*) { return false; }
virtual bool onIsValid(GrContext*) const;
virtual bool onIsValid(GrContext*) const { return true; }
virtual bool onQueryYUV8(SkYUVSizeInfo*, SkYUVColorSpace*) const {
return false;
}
virtual bool onGetYUV8Planes(const SkYUVSizeInfo&, void*[3] /*planes*/) {
return false;
}
virtual bool onQueryYUV8(SkYUVSizeInfo*, SkYUVColorSpace*) const { return false; }
virtual bool onGetYUV8Planes(const SkYUVSizeInfo&, void*[3] /*planes*/) { return false; }
struct Options {
Options()

View File

@ -104,21 +104,6 @@ sk_sp<GrTextureProxy> SkImageGenerator::onGenerateTexture(GrContext*, const SkIm
}
#endif
/////////////////////////////////////////////////////////////////////////////////////////////
SkData* SkImageGenerator::onRefEncodedData() {
return nullptr;
}
bool SkImageGenerator::onGetPixels(const SkImageInfo& info, void* dst, size_t rb,
SkPMColor* colors, int* colorCount) {
return false;
}
bool SkImageGenerator::onIsValid(GrContext*) const {
return true;
}
///////////////////////////////////////////////////////////////////////////////////////////////////
#include "SkBitmap.h"

View File

@ -89,20 +89,6 @@ GrBackendTextureImageGenerator::~GrBackendTextureImageGenerator() {
fRefHelper->unref();
}
bool GrBackendTextureImageGenerator::onGetPixels(const SkImageInfo& info, void* pixels,
size_t rowBytes, SkPMColor ctable[],
int* ctableCount) {
// TODO: Is there any way to implement this? I don't think so.
return false;
}
bool GrBackendTextureImageGenerator::onGetPixels(const SkImageInfo& info, void* pixels,
size_t rowBytes, const Options& opts) {
// TODO: Is there any way to implement this? I don't think so.
return false;
}
///////////////////////////////////////////////////////////////////////////////////////////////////
#if SK_SUPPORT_GPU

View File

@ -22,12 +22,12 @@ public:
~GrBackendTextureImageGenerator();
protected:
bool onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes, SkPMColor ctable[],
int* ctableCount) override;
bool onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes, const Options& opts)
override;
// NOTE: We would like to validate that the owning context hasn't been abandoned, but we can't
// do that safely (we might be on another thread). So assume everything is fine.
bool onIsValid(GrContext*) const override { return true; }
#if SK_SUPPORT_GPU
bool onCanGenerateTexture() const override { return true; }
sk_sp<GrTextureProxy> onGenerateTexture(GrContext*, const SkImageInfo&,
const SkIPoint&) override;
#endif