本文整理汇总了C++中GrGLProgramDataManager::set2fv方法的典型用法代码示例。如果您正苦于以下问题:C++ GrGLProgramDataManager::set2fv方法的具体用法?C++ GrGLProgramDataManager::set2fv怎么用?C++ GrGLProgramDataManager::set2fv使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GrGLProgramDataManager
的用法示例。
在下文中一共展示了GrGLProgramDataManager::set2fv方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setData
void GrGLConvolutionEffect::setData(const GrGLProgramDataManager& pdman,
const GrProcessor& processor) {
const GrConvolutionEffect& conv = processor.cast<GrConvolutionEffect>();
GrTexture& texture = *conv.texture(0);
// the code we generated was for a specific kernel radius
SkASSERT(conv.radius() == fRadius);
float imageIncrement[2] = { 0 };
float ySign = texture.origin() != kTopLeft_GrSurfaceOrigin ? 1.0f : -1.0f;
switch (conv.direction()) {
case Gr1DKernelEffect::kX_Direction:
imageIncrement[0] = 1.0f / texture.width();
break;
case Gr1DKernelEffect::kY_Direction:
imageIncrement[1] = ySign / texture.height();
break;
default:
SkFAIL("Unknown filter direction.");
}
pdman.set2fv(fImageIncrementUni, 1, imageIncrement);
if (conv.useBounds()) {
const float* bounds = conv.bounds();
if (Gr1DKernelEffect::kY_Direction == conv.direction() &&
texture.origin() != kTopLeft_GrSurfaceOrigin) {
pdman.set2f(fBoundsUni, 1.0f - bounds[1], 1.0f - bounds[0]);
} else {
pdman.set2f(fBoundsUni, bounds[0], bounds[1]);
}
}
pdman.set1fv(fKernelUni, this->width(), conv.kernel());
}
示例2: onSetData
void GrGLBicubicEffect::onSetData(const GrGLProgramDataManager& pdman,
const GrProcessor& processor) {
const GrBicubicEffect& bicubicEffect = processor.cast<GrBicubicEffect>();
const GrTexture& texture = *processor.texture(0);
float imageIncrement[2];
imageIncrement[0] = 1.0f / texture.width();
imageIncrement[1] = 1.0f / texture.height();
pdman.set2fv(fImageIncrementUni, 1, imageIncrement);
pdman.setMatrix4f(fCoefficientsUni, bicubicEffect.coefficients());
fDomain.setData(pdman, bicubicEffect.domain(), texture.origin());
}