本文整理汇总了C++中nux::GraphicsEngine::PopClippingRectangle方法的典型用法代码示例。如果您正苦于以下问题:C++ GraphicsEngine::PopClippingRectangle方法的具体用法?C++ GraphicsEngine::PopClippingRectangle怎么用?C++ GraphicsEngine::PopClippingRectangle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nux::GraphicsEngine
的用法示例。
在下文中一共展示了GraphicsEngine::PopClippingRectangle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawContent
void UserPromptView::DrawContent(nux::GraphicsEngine& graphics_engine, bool force_draw)
{
nux::Geometry const& geo = GetGeometry();
graphics_engine.PushClippingRectangle(geo);
if (!IsFullRedraw())
{
bg_layer_.reset(CrateBackgroundLayer(geo.width, geo.height));
nux::GetPainter().PushLayer(graphics_engine, geo, bg_layer_.get());
}
if (caps_lock_on_)
{
for (auto const& text_entry : focus_queue_)
PaintWarningIcon(graphics_engine, text_entry->GetGeometry());
if (focus_queue_.empty())
PaintWarningIcon(graphics_engine, cached_focused_geo_);
}
if (GetLayout())
GetLayout()->ProcessDraw(graphics_engine, force_draw);
if (!IsFullRedraw())
nux::GetPainter().PopBackground();
graphics_engine.PopClippingRectangle();
}
示例2: Draw
void OverlaySpinner::Draw(nux::GraphicsEngine& GfxContext, bool force_draw)
{
nux::Geometry const& geo = GetGeometry();
nux::TexCoordXForm texxform;
GfxContext.PushClippingRectangle(geo);
nux::GetPainter().PaintBackground(GfxContext, geo);
texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT);
texxform.min_filter = nux::TEXFILTER_LINEAR;
texxform.mag_filter = nux::TEXFILTER_LINEAR;
unsigned int current_alpha_blend;
unsigned int current_src_blend_factor;
unsigned int current_dest_blend_factor;
GfxContext.GetRenderStates().GetBlend(current_alpha_blend, current_src_blend_factor, current_dest_blend_factor);
GfxContext.GetRenderStates().SetBlend(true, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
nux::Geometry spin_geo(geo.x + ((geo.width - spin_->GetWidth()) / 2),
geo.y + ((geo.height - spin_->GetHeight()) / 2),
spin_->GetWidth(),
spin_->GetHeight());
// Geometry (== Rect) uses integers which were rounded above,
// hence an extra 0.5 offset for odd sizes is needed
// because pure floating point is not being used.
int spin_offset_w = !(geo.width % 2) ? 0 : 1;
int spin_offset_h = !(geo.height % 2) ? 0 : 1;
nux::Matrix4 matrix_texture;
matrix_texture = nux::Matrix4::TRANSLATE(-spin_geo.x - (spin_geo.width + spin_offset_w) / 2.0f,
-spin_geo.y - (spin_geo.height + spin_offset_h) / 2.0f, 0) * matrix_texture;
matrix_texture = rotate_ * matrix_texture;
matrix_texture = nux::Matrix4::TRANSLATE(spin_geo.x + (spin_geo.width + spin_offset_w) / 2.0f,
spin_geo.y + (spin_geo.height + spin_offset_h) / 2.0f, 0) * matrix_texture;
GfxContext.SetModelViewMatrix(GfxContext.GetModelViewMatrix() * matrix_texture);
GfxContext.QRP_1Tex(spin_geo.x,
spin_geo.y,
spin_geo.width,
spin_geo.height,
spin_->GetDeviceTexture(),
texxform,
nux::color::White);
// revert to model view matrix stack
GfxContext.ApplyModelViewMatrix();
GfxContext.PopClippingRectangle();
GfxContext.GetRenderStates().SetBlend(current_alpha_blend, current_src_blend_factor, current_dest_blend_factor);
if (!frame_timeout_)
{
frame_timeout_.reset(new glib::Timeout(22, sigc::mem_fun(this, &OverlaySpinner::OnFrameTimeout)));
}
}
示例3: Draw
void ApplicationPreview::Draw(nux::GraphicsEngine& gfx_engine, bool force_draw)
{
nux::Geometry const& base = GetGeometry();
gfx_engine.PushClippingRectangle(base);
nux::GetPainter().PaintBackground(gfx_engine, base);
gfx_engine.PopClippingRectangle();
}
示例4: DrawContent
void PreviewRatingsWidget::DrawContent(nux::GraphicsEngine& gfx_engine, bool force_draw)
{
nux::Geometry const& base = GetGeometry();
gfx_engine.PushClippingRectangle(base);
if (GetCompositionLayout())
GetCompositionLayout()->ProcessDraw(gfx_engine, force_draw);
gfx_engine.PopClippingRectangle();
}
示例5: DrawContent
void HudButton::DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw)
{
if (skip_draw_)
return;
if (IsFullRedraw())
{
GfxContext.PushClippingRectangle(GetGeometry());
hlayout_->ProcessDraw(GfxContext, force_draw);
GfxContext.PopClippingRectangle();
}
}
示例6: Draw
void UserPromptView::Draw(nux::GraphicsEngine& graphics_engine, bool /* force_draw */)
{
nux::Geometry const& geo = GetGeometry();
graphics_engine.PushClippingRectangle(geo);
nux::GetPainter().PaintBackground(graphics_engine, geo);
EnsureBGLayer();
nux::GetPainter().PushDrawLayer(graphics_engine, geo, bg_layer_.get());
nux::GetPainter().PopBackground();
graphics_engine.PopClippingRectangle();
}
示例7: Draw
void HudButton::Draw(nux::GraphicsEngine& GfxContext, bool force_draw)
{
if (skip_draw_)
return;
nux::Geometry const& geo = GetGeometry();
GfxContext.PushClippingRectangle(geo);
gPainter.PaintBackground(GfxContext, geo);
// set up our texture mode
nux::TexCoordXForm texxform;
texxform.SetWrap(nux::TEXWRAP_CLAMP, nux::TEXWRAP_CLAMP);
texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
// clear what is behind us
unsigned int alpha = 0, src = 0, dest = 0;
GfxContext.GetRenderStates().GetBlend(alpha, src, dest);
GfxContext.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER);
GfxContext.GetRenderStates().SetBlend(true);
nux::Color col(nux::color::Black);
col.alpha = 0;
GfxContext.QRP_Color(geo.x,
geo.y,
geo.width,
geo.height,
col);
nux::BaseTexture* texture = normal_->GetTexture();
if (HasKeyFocus() || fake_focused())
texture = active_->GetTexture();
else if (HasKeyFocus())
texture = prelight_->GetTexture();
else if (GetVisualState() == nux::ButtonVisualState::VISUAL_STATE_PRESSED)
texture = active_->GetTexture();
GfxContext.QRP_1Tex(geo.x,
geo.y,
texture->GetWidth(),
texture->GetHeight(),
texture->GetDeviceTexture(),
texxform,
nux::color::White);
GfxContext.GetRenderStates().SetBlend(alpha, src, dest);
GfxContext.PopClippingRectangle();
}
示例8: DrawContent
void ApplicationPreview::DrawContent(nux::GraphicsEngine& gfx_engine, bool force_draw)
{
nux::Geometry const& base = GetGeometry();
gfx_engine.PushClippingRectangle(base);
unsigned int alpha, src, dest = 0;
gfx_engine.GetRenderStates().GetBlend(alpha, src, dest);
gfx_engine.GetRenderStates().SetBlend(true, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
if (GetCompositionLayout())
GetCompositionLayout()->ProcessDraw(gfx_engine, force_draw);
gfx_engine.GetRenderStates().SetBlend(alpha, src, dest);
gfx_engine.PopClippingRectangle();
}
示例9: DrawContent
virtual void DrawContent(nux::GraphicsEngine& gfx_engine, bool force_draw)
{
nux::Geometry const& base = GetGeometry();
gfx_engine.PushClippingRectangle(base);
if (!IsFullRedraw())
nux::GetPainter().PushLayer(gfx_engine, GetGeometry(), bg_layer_.get());
if (GetCompositionLayout())
GetCompositionLayout()->ProcessDraw(gfx_engine, force_draw);
if (!IsFullRedraw())
nux::GetPainter().PopBackground();
gfx_engine.PopClippingRectangle();
}
示例10: DrawContent
void FilterBar::DrawContent(nux::GraphicsEngine& graphics_engine, bool force_draw)
{
graphics_engine.PushClippingRectangle(GetGeometry());
if (!IsFullRedraw() && RedirectedAncestor())
{
for (auto iter: filter_map_)
{
FilterExpanderLabel* filter_view = iter.second;
if (filter_view && filter_view->IsVisible() && filter_view->IsRedrawNeeded())
graphics::ClearGeometry(filter_view->GetGeometry());
}
}
GetLayout()->ProcessDraw(graphics_engine, force_draw);
graphics_engine.PopClippingRectangle();
}
示例11: Draw
virtual void Draw(nux::GraphicsEngine& gfx_engine, bool force_draw)
{
nux::Geometry const& base = GetGeometry();
gfx_engine.PushClippingRectangle(base);
nux::GetPainter().PaintBackground(gfx_engine, base);
unsigned int alpha, src, dest = 0;
gfx_engine.GetRenderStates().GetBlend(alpha, src, dest);
gfx_engine.GetRenderStates().SetBlend(true, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
bg_layer_->SetGeometry(GetGeometry());
nux::GetPainter().RenderSinglePaintLayer(gfx_engine, GetGeometry(), bg_layer_.get());
gfx_engine.GetRenderStates().SetBlend(alpha, src, dest);
gfx_engine.PopClippingRectangle();
}
示例12: Draw
void ScopeBarIcon::Draw(nux::GraphicsEngine& graphics_engine, bool force_draw)
{
nux::Geometry const& geo = GetGeometry();
graphics_engine.PushClippingRectangle(geo);
if (HasKeyFocus() && focus_layer_)
{
nux::Geometry geo(GetGeometry());
nux::AbstractPaintLayer* layer = focus_layer_.get();
layer->SetGeometry(geo);
layer->Renderlayer(graphics_engine);
}
if (texture())
{
unsigned int current_alpha_blend;
unsigned int current_src_blend_factor;
unsigned int current_dest_blend_factor;
graphics_engine.GetRenderStates().GetBlend(current_alpha_blend, current_src_blend_factor, current_dest_blend_factor);
graphics_engine.GetRenderStates().SetBlend(true, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
float opacity = active ? 1.0f : inactive_opacity_;
int width = 0, height = 0;
GetTextureSize(&width, &height);
nux::TexCoordXForm texxform;
texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
texxform.SetWrap(nux::TEXWRAP_CLAMP_TO_BORDER, nux::TEXWRAP_CLAMP_TO_BORDER);
graphics_engine.QRP_1Tex(geo.x + ((geo.width - width) / 2),
geo.y + ((geo.height - height) / 2),
width,
height,
texture()->GetDeviceTexture(),
texxform,
nux::color::White * opacity);
graphics_engine.GetRenderStates().SetBlend(current_alpha_blend, current_src_blend_factor, current_dest_blend_factor);
}
graphics_engine.PopClippingRectangle();
}
示例13: DrawContent
void FilterExpanderLabel::DrawContent(nux::GraphicsEngine& graphics_engine, bool force_draw)
{
graphics_engine.PushClippingRectangle(GetGeometry());
int pushed_paint_layers = 0;
if (!IsFullRedraw())
{
if (RedirectedAncestor())
{
if (cairo_label_->IsRedrawNeeded())
graphics::ClearGeometry(cairo_label_->GetGeometry());
if (expand_icon_->IsRedrawNeeded())
graphics::ClearGeometry(expand_icon_->GetGeometry());
if (right_hand_contents_ && right_hand_contents_->IsRedrawNeeded())
graphics::ClearGeometry(right_hand_contents_->GetGeometry());
if (expanded())
ClearRedirectedRenderChildArea();
}
if (focus_layer_ && ShouldBeHighlighted())
{
++pushed_paint_layers;
nux::GetPainter().PushLayer(graphics_engine, focus_layer_->GetGeometry(), focus_layer_.get());
}
}
else
{
nux::GetPainter().PushPaintLayerStack();
}
GetLayout()->ProcessDraw(graphics_engine, force_draw);
if (IsFullRedraw())
{
nux::GetPainter().PopPaintLayerStack();
}
else if (pushed_paint_layers > 0)
{
nux::GetPainter().PopBackground(pushed_paint_layers);
}
graphics_engine.PopClippingRectangle();
}
示例14: DrawContent
void UserPromptView::DrawContent(nux::GraphicsEngine& graphics_engine, bool force_draw)
{
nux::Geometry const& geo = GetGeometry();
graphics_engine.PushClippingRectangle(geo);
if (!IsFullRedraw())
{
EnsureBGLayer();
nux::GetPainter().PushLayer(graphics_engine, geo, bg_layer_.get());
}
if (GetLayout())
GetLayout()->ProcessDraw(graphics_engine, force_draw);
if (!IsFullRedraw())
nux::GetPainter().PopBackground();
graphics_engine.PopClippingRectangle();
}
示例15: Draw
void FilterExpanderLabel::Draw(nux::GraphicsEngine& graphics_engine, bool force_draw)
{
nux::Geometry const& base = GetGeometry();
graphics_engine.PushClippingRectangle(base);
if (ShouldBeHighlighted())
{
nux::Geometry geo(top_bar_layout_->GetGeometry());
geo.x = base.x;
geo.width = base.width;
if (!focus_layer_)
focus_layer_.reset(dash::Style::Instance().FocusOverlay(geo.width, geo.height));
focus_layer_->SetGeometry(geo);
focus_layer_->Renderlayer(graphics_engine);
}
graphics_engine.PopClippingRectangle();
}