本文整理汇总了C++中Attributes::testFlag方法的典型用法代码示例。如果您正苦于以下问题:C++ Attributes::testFlag方法的具体用法?C++ Attributes::testFlag怎么用?C++ Attributes::testFlag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Attributes
的用法示例。
在下文中一共展示了Attributes::testFlag方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateOpacityForDisabledWidgets
void updateOpacityForDisabledWidgets()
{
float const opac = (self().isDisabled()? .3f : 1.f);
if (opacityWhenDisabled.target() != opac)
{
opacityWhenDisabled.setValue(opac, .3f);
}
if (firstUpdateAfterCreation ||
!attribs.testFlag(AnimateOpacityWhenEnabledOrDisabled))
{
opacityWhenDisabled.finish();
}
}
示例2: drawBlurredBackground
void drawBlurredBackground()
{
if (background.type == Background::SharedBlur ||
background.type == Background::SharedBlurWithBorderGlow)
{
// Use another widget's blur.
DENG2_ASSERT(background.blur != 0);
if (background.blur)
{
background.blur->drawBlurredRect(self().rule().recti(), background.solidFill);
}
return;
}
if (background.type != Background::Blurred &&
background.type != Background::BlurredWithBorderGlow &&
background.type != Background::BlurredWithSolidFill)
{
deinitBlur();
return;
}
// Make sure blurring is initialized.
initBlur();
DENG2_ASSERT(blur->fb[0]->isReady());
// Pass 1: render all the widgets behind this one onto the first blur
// texture, downsampled.
GLState::push()
.setTarget(*blur->fb[0])
.setViewport(Rectangleui::fromSize(blur->size));
blur->fb[0]->clear(GLFramebuffer::Depth);
self().root().drawUntil(self());
GLState::pop();
blur->fb[0]->resolveSamples();
// Pass 2: apply the horizontal blur filter to draw the background
// contents onto the second blur texture.
GLState::push()
.setTarget(*blur->fb[1])
.setViewport(Rectangleui::fromSize(blur->size));
blur->uTex = blur->fb[0]->colorTexture();
blur->uMvpMatrix = Matrix4f::ortho(0, 1, 0, 1);
blur->uWindow = Vector4f(0, 0, 1, 1);
blur->drawable.setProgram(blur->drawable.program());
blur->drawable.draw();
GLState::pop();
blur->fb[1]->resolveSamples();
// Pass 3: apply the vertical blur filter, drawing the final result
// into the original target.
Vector4f blurColor = background.solidFill;
float blurOpacity = self().visibleOpacity();
if (background.type == Background::BlurredWithSolidFill)
{
blurColor.w = 1;
}
if (!attribs.testFlag(DontDrawContent) && blurColor.w > 0 && blurOpacity > 0)
{
self().drawBlurredRect(self().rule().recti(), blurColor, blurOpacity);
}
}