本文整理汇总了C++中SkAutoTDelete::lockAsBitmapOnlyIfAlreadyCached方法的典型用法代码示例。如果您正苦于以下问题:C++ SkAutoTDelete::lockAsBitmapOnlyIfAlreadyCached方法的具体用法?C++ SkAutoTDelete::lockAsBitmapOnlyIfAlreadyCached怎么用?C++ SkAutoTDelete::lockAsBitmapOnlyIfAlreadyCached使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkAutoTDelete
的用法示例。
在下文中一共展示了SkAutoTDelete::lockAsBitmapOnlyIfAlreadyCached方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onReadPixels
bool SkImage_Generator::onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRB,
int srcX, int srcY, CachingHint chint) const {
SkBitmap bm;
if (kDisallow_CachingHint == chint) {
if (fCache->lockAsBitmapOnlyIfAlreadyCached(&bm)) {
return bm.readPixels(dstInfo, dstPixels, dstRB, srcX, srcY);
} else {
// Try passing the caller's buffer directly down to the generator. If this fails we
// may still succeed in the general case, as the generator may prefer some other
// config, which we could then convert via SkBitmap::readPixels.
if (fCache->directGeneratePixels(dstInfo, dstPixels, dstRB, srcX, srcY)) {
return true;
}
// else fall through
}
}
if (this->getROPixels(&bm, chint)) {
return bm.readPixels(dstInfo, dstPixels, dstRB, srcX, srcY);
}
return false;
}