SkImageGenerator::NewFromPicture(configs[i].size, fPicture.get(), &m,
p.getAlpha() != 255 ? &p : nullptr));
SkBitmap bm;
- gen->generateBitmap(&bm);
+ gen->generateBitmap(&bm, SkImageInfo::MakeN32Premul(configs[i].size));
const SkScalar x = kDrawSize * (i % kDrawsPerRow);
const SkScalar y = kDrawSize * (i / kDrawsPerRow);
*/
bool getYUV8Planes(const SkYUVSizeInfo& sizeInfo, void* planes[3]);
- /**
- * Returns true if the generate can efficiently return a texture (given the properties of the
- * proxy). By default, simple codecs will usually return false, since they must be decoded
- * on the CPU and then uploaded to become a texture.
- */
- bool canGenerateTexture(const GrContextThreadSafeProxy& proxy) {
- return this->onCanGenerateTexture(proxy);
- }
-
/**
* If the generator can natively/efficiently return its pixels as a GPU image (backed by a
* texture) this will return that image. If not, this will return NULL.
static SkImageGenerator* NewFromPicture(const SkISize&, const SkPicture*, const SkMatrix*,
const SkPaint*);
- bool tryGenerateBitmap(SkBitmap* bm) {
- return this->tryGenerateBitmap(bm, nullptr, nullptr);
- }
bool tryGenerateBitmap(SkBitmap* bm, const SkImageInfo& info, SkBitmap::Allocator* allocator) {
return this->tryGenerateBitmap(bm, &info, allocator);
}
- void generateBitmap(SkBitmap* bm) {
- if (!this->tryGenerateBitmap(bm, nullptr, nullptr)) {
- sk_throw();
- }
- }
void generateBitmap(SkBitmap* bm, const SkImageInfo& info) {
if (!this->tryGenerateBitmap(bm, &info, nullptr)) {
sk_throw();
return false;
}
- virtual bool onCanGenerateTexture(const GrContextThreadSafeProxy&) {
- return false;
- }
virtual GrTexture* onGenerateTexture(GrContext*, const SkIRect*) {
return nullptr;
}