本文整理汇总了C++中GrGLProgramDataManager::set4f方法的典型用法代码示例。如果您正苦于以下问题:C++ GrGLProgramDataManager::set4f方法的具体用法?C++ GrGLProgramDataManager::set4f怎么用?C++ GrGLProgramDataManager::set4f使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GrGLProgramDataManager
的用法示例。
在下文中一共展示了GrGLProgramDataManager::set4f方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setData
void GrGLMagnifierEffect::setData(const GrGLProgramDataManager& pdman,
const GrProcessor& effect) {
const GrMagnifierEffect& zoom = effect.cast<GrMagnifierEffect>();
pdman.set2f(fOffsetVar, zoom.x_offset(), zoom.y_offset());
pdman.set2f(fInvZoomVar, zoom.x_inv_zoom(), zoom.y_inv_zoom());
pdman.set2f(fInvInsetVar, zoom.x_inv_inset(), zoom.y_inv_inset());
pdman.set4f(fBoundsVar, zoom.bounds().x(), zoom.bounds().y(),
zoom.bounds().width(), zoom.bounds().height());
}
示例2: setData
void GLAARectEffect::setData(const GrGLProgramDataManager& pdman, const GrProcessor& processor) {
const AARectEffect& aare = processor.cast<AARectEffect>();
const SkRect& rect = aare.getRect();
if (rect != fPrevRect) {
pdman.set4f(fRectUniform, rect.fLeft + 0.5f, rect.fTop + 0.5f,
rect.fRight - 0.5f, rect.fBottom - 0.5f);
fPrevRect = rect;
}
}
示例3: onSetData
void GLEllipseEffect::onSetData(const GrGLProgramDataManager& pdman, const GrProcessor& effect) {
const EllipseEffect& ee = effect.cast<EllipseEffect>();
if (ee.getRadii() != fPrevRadii || ee.getCenter() != fPrevCenter) {
SkScalar invRXSqd = 1.f / (ee.getRadii().fX * ee.getRadii().fX);
SkScalar invRYSqd = 1.f / (ee.getRadii().fY * ee.getRadii().fY);
pdman.set4f(fEllipseUniform, ee.getCenter().fX, ee.getCenter().fY, invRXSqd, invRYSqd);
fPrevCenter = ee.getCenter();
fPrevRadii = ee.getRadii();
}
}
示例4: setData
void GLEllipticalRRectEffect::setData(const GrGLProgramDataManager& pdman,
const GrProcessor& effect) {
const EllipticalRRectEffect& erre = effect.cast<EllipticalRRectEffect>();
const SkRRect& rrect = erre.getRRect();
if (rrect != fPrevRRect) {
SkRect rect = rrect.getBounds();
const SkVector& r0 = rrect.radii(SkRRect::kUpperLeft_Corner);
SkASSERT(r0.fX >= kRadiusMin);
SkASSERT(r0.fY >= kRadiusMin);
switch (erre.getRRect().getType()) {
case SkRRect::kSimple_Type:
rect.inset(r0.fX, r0.fY);
pdman.set2f(fInvRadiiSqdUniform, 1.f / (r0.fX * r0.fX),
1.f / (r0.fY * r0.fY));
break;
case SkRRect::kNinePatch_Type: {
const SkVector& r1 = rrect.radii(SkRRect::kLowerRight_Corner);
SkASSERT(r1.fX >= kRadiusMin);
SkASSERT(r1.fY >= kRadiusMin);
rect.fLeft += r0.fX;
rect.fTop += r0.fY;
rect.fRight -= r1.fX;
rect.fBottom -= r1.fY;
pdman.set4f(fInvRadiiSqdUniform, 1.f / (r0.fX * r0.fX),
1.f / (r0.fY * r0.fY),
1.f / (r1.fX * r1.fX),
1.f / (r1.fY * r1.fY));
break;
}
default:
SkFAIL("RRect should always be simple or nine-patch.");
}
pdman.set4f(fInnerRectUniform, rect.fLeft, rect.fTop, rect.fRight, rect.fBottom);
fPrevRRect = rrect;
}
}
示例5: onSetData
void onSetData(const GrGLProgramDataManager& pdman, const GrProcessor& proc) override {
const GrArithmeticFP& arith = proc.cast<GrArithmeticFP>();
pdman.set4f(fKUni, arith.k1(), arith.k2(), arith.k3(), arith.k4());
fEnforcePMColor = arith.enforcePMColor();
}