本文整理汇总了C++中GrFragmentProcessor::unref方法的典型用法代码示例。如果您正苦于以下问题:C++ GrFragmentProcessor::unref方法的具体用法?C++ GrFragmentProcessor::unref怎么用?C++ GrFragmentProcessor::unref使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GrFragmentProcessor
的用法示例。
在下文中一共展示了GrFragmentProcessor::unref方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: asFragmentProcessors
bool SkModeColorFilter::asFragmentProcessors(GrContext*, GrProcessorDataManager*,
SkTDArray<GrFragmentProcessor*>* array) const {
if (SkXfermode::kDst_Mode != fMode) {
GrFragmentProcessor* frag = ModeColorFilterEffect::Create(SkColor2GrColor(fColor), fMode);
if (frag) {
if (array) {
*array->append() = frag;
} else {
frag->unref();
SkDEBUGCODE(frag = nullptr;)
}
return true;
}
}
示例2: asFragmentProcessors
bool SkLumaColorFilter::asFragmentProcessors(GrContext*, GrProcessorDataManager*,
SkTDArray<GrFragmentProcessor*>* array) const {
GrFragmentProcessor* frag = LumaColorFilterEffect::Create();
if (frag) {
if (array) {
*array->append() = frag;
} else {
frag->unref();
SkDEBUGCODE(frag = nullptr;)
}
return true;
}
return false;
}
示例3: asFragmentProcessors
bool SkColorCubeFilter::asFragmentProcessors(GrContext* context, GrProcessorDataManager*,
SkTDArray<GrFragmentProcessor*>* array) const {
static const GrUniqueKey::Domain kDomain = GrUniqueKey::GenerateDomain();
GrUniqueKey key;
GrUniqueKey::Builder builder(&key, kDomain, 2);
builder[0] = fUniqueID;
builder[1] = fCache.cubeDimension();
builder.finish();
GrSurfaceDesc desc;
desc.fWidth = fCache.cubeDimension();
desc.fHeight = fCache.cubeDimension() * fCache.cubeDimension();
desc.fConfig = kRGBA_8888_GrPixelConfig;
SkAutoTUnref<GrTexture> textureCube(
context->textureProvider()->findAndRefTextureByUniqueKey(key));
if (!textureCube) {
textureCube.reset(context->textureProvider()->createTexture(
desc, true, fCubeData->data(), 0));
if (textureCube) {
context->textureProvider()->assignUniqueKeyToTexture(key, textureCube);
}
}
GrFragmentProcessor* frag = textureCube ? GrColorCubeEffect::Create(textureCube) : NULL;
if (frag) {
if (array) {
*array->append() = frag;
} else {
frag->unref();
SkDEBUGCODE(frag = NULL;)
}
return true;
}
return false;
}