Merge lp:~3v1n0/unity/scale-decoration-cache-6.0 into lp:unity/6.0

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Brandon Schaefer
Approved revision: no longer in the source branch.
Merged at revision: 2738
Proposed branch: lp:~3v1n0/unity/scale-decoration-cache-6.0
Merge into: lp:unity/6.0
Prerequisite: lp:~3v1n0/unity/scale-close-middle-click-6.0
Diff against target: 517 lines (+165/-131)
2 files modified
plugins/unityshell/src/unityshell.cpp (+124/-80)
plugins/unityshell/src/unityshell.h (+41/-51)
To merge this branch: bzr merge lp:~3v1n0/unity/scale-decoration-cache-6.0
Reviewer Review Type Date Requested Status
Brandon Schaefer (community) Approve
Review via email: mp+126078@code.launchpad.net

Commit message

UnityWindow: when spreading, render once an empty decoration texture at full size and scale it via OpenGL

This saves a lot of drawing and improves the performances of the unity Spread. Also, don't redraw the decoration texture for selected windows if not needed.
Finally, cleanup the header file

Description of the change

To post a comment you must log in.
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

Confirmed still working :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plugins/unityshell/src/unityshell.cpp'
--- plugins/unityshell/src/unityshell.cpp 2012-09-24 19:42:22 +0000
+++ plugins/unityshell/src/unityshell.cpp 2012-09-24 19:42:22 +0000
@@ -87,9 +87,6 @@
8787
88UnityScreen* uScreen = 0;88UnityScreen* uScreen = 0;
8989
90const unsigned int SCALE_CLOSE_ICON_SIZE = 19;
91const unsigned int SCALE_ITEMS_PADDING = 5;
92
93void reset_glib_logging();90void reset_glib_logging();
94void configure_logging();91void configure_logging();
95void capture_g_log_calls(const gchar* log_domain,92void capture_g_log_calls(const gchar* log_domain,
@@ -111,8 +108,8 @@
111} // anon namespace108} // anon namespace
112109
113UnityScreen::UnityScreen(CompScreen* screen)110UnityScreen::UnityScreen(CompScreen* screen)
114 : BaseSwitchScreen (screen)111 : BaseSwitchScreen(screen)
115 , PluginClassHandler <UnityScreen, CompScreen> (screen)112 , PluginClassHandler <UnityScreen, CompScreen>(screen)
116 , screen(screen)113 , screen(screen)
117 , cScreen(CompositeScreen::get(screen))114 , cScreen(CompositeScreen::get(screen))
118 , gScreen(GLScreen::get(screen))115 , gScreen(GLScreen::get(screen))
@@ -669,7 +666,12 @@
669 UnityWindow::CleanupSharedTextures();666 UnityWindow::CleanupSharedTextures();
670667
671 if (WindowManager::Default()->IsScaleActive())668 if (WindowManager::Default()->IsScaleActive())
669 {
672 UnityWindow::SetupSharedTextures();670 UnityWindow::SetupSharedTextures();
671
672 for (auto const& swin : ScaleScreen::get(screen)->getWindows())
673 UnityWindow::get(swin->window)->CleanupCachedTextures();
674 }
673}675}
674676
675void UnityScreen::paintDisplay()677void UnityScreen::paintDisplay()
@@ -3380,11 +3382,23 @@
3380GLTexture::List UnityWindow::close_prelight_tex_;3382GLTexture::List UnityWindow::close_prelight_tex_;
3381GLTexture::List UnityWindow::close_pressed_tex_;3383GLTexture::List UnityWindow::close_pressed_tex_;
33823384
3385namespace scale
3386{
3387namespace decoration
3388{
3389const unsigned CLOSE_SIZE = 19;
3390const unsigned ITEMS_PADDING = 5;
3391const unsigned RADIUS = 8;
3392}
3393}
3394
3383struct UnityWindow::CairoContext3395struct UnityWindow::CairoContext
3384{3396{
3385 CairoContext(int width, int height)3397 CairoContext(unsigned width, unsigned height)
3386 : pixmap_(XCreatePixmap(screen->dpy(), screen->root(), width, height, 32))3398 : w_(width)
3387 , texture_(GLTexture::bindPixmapToTexture(pixmap_, width, height, 32))3399 , h_(height)
3400 , pixmap_(XCreatePixmap(screen->dpy(), screen->root(), w_, h_, 32))
3401 , texture_(GLTexture::bindPixmapToTexture(pixmap_, w_, h_, 32))
3388 , surface_(nullptr)3402 , surface_(nullptr)
3389 , cr_(nullptr)3403 , cr_(nullptr)
3390 {3404 {
@@ -3406,7 +3420,7 @@
3406 cairo_restore(cr_);3420 cairo_restore(cr_);
3407 }3421 }
34083422
3409 ~CairoContext ()3423 ~CairoContext()
3410 {3424 {
3411 if (cr_)3425 if (cr_)
3412 cairo_destroy(cr_);3426 cairo_destroy(cr_);
@@ -3414,12 +3428,12 @@
3414 if (surface_)3428 if (surface_)
3415 cairo_surface_destroy(surface_);3429 cairo_surface_destroy(surface_);
34163430
3417 texture_.clear();
3418
3419 if (pixmap_)3431 if (pixmap_)
3420 XFreePixmap(screen->dpy (), pixmap_);3432 XFreePixmap(screen->dpy(), pixmap_);
3421 }3433 }
34223434
3435 unsigned w_;
3436 unsigned h_;
3423 Pixmap pixmap_;3437 Pixmap pixmap_;
3424 GLTexture::List texture_;3438 GLTexture::List texture_;
3425 cairo_surface_t* surface_;3439 cairo_surface_t* surface_;
@@ -3478,8 +3492,8 @@
3478 }3492 }
3479 }3493 }
34803494
3481 WindowManager::Default()->initiate_spread.connect(sigc::mem_fun(this, &UnityWindow::OnInitiateSpreed));3495 WindowManager::Default()->initiate_spread.connect(sigc::mem_fun(this, &UnityWindow::OnInitiateSpread));
3482 WindowManager::Default()->terminate_spread.connect(sigc::mem_fun(this, &UnityWindow::OnTerminateSpreed));3496 WindowManager::Default()->terminate_spread.connect(sigc::mem_fun(this, &UnityWindow::OnTerminateSpread));
3483}3497}
34843498
3485void UnityWindow::AddProperties(GVariantBuilder* builder)3499void UnityWindow::AddProperties(GVariantBuilder* builder)
@@ -3505,8 +3519,9 @@
3505 return "Window";3519 return "Window";
3506}3520}
35073521
3522
3508void UnityWindow::DrawTexture(GLTexture::List const& textures, GLWindowPaintAttrib const& attrib,3523void UnityWindow::DrawTexture(GLTexture::List const& textures, GLWindowPaintAttrib const& attrib,
3509 GLMatrix const& transform, unsigned int mask, int x, int y)3524 GLMatrix const& transform, unsigned int mask, int x, int y, double scale)
3510{3525{
3511 for (auto const& texture : textures)3526 for (auto const& texture : textures)
3512 {3527 {
@@ -3527,12 +3542,40 @@
3527 {3542 {
3528 GLMatrix wTransform(transform);3543 GLMatrix wTransform(transform);
3529 wTransform.translate(x, y, 0.0f);3544 wTransform.translate(x, y, 0.0f);
3545 wTransform.scale(scale, scale, 1.0f);
35303546
3531 gWindow->glDrawTexture(texture, wTransform, attrib, mask);3547 gWindow->glDrawTexture(texture, wTransform, attrib, mask);
3532 }3548 }
3533 }3549 }
3534}3550}
35353551
3552void UnityWindow::RenderDecoration(CairoContext const& context, double aspect)
3553{
3554 cairo_save(context.cr_);
3555
3556 // Draw window decoration based on gtk style
3557 cairo_push_group(context.cr_);
3558 auto& style = panel::Style::Instance();
3559 gtk_render_background(style.GetStyleContext(), context.cr_, 0, 0, context.w_, context.h_);
3560 gtk_render_frame(style.GetStyleContext(), context.cr_, 0, 0, context.w_, context.h_);
3561 cairo_pop_group_to_source(context.cr_);
3562
3563 // Round window decoration top border
3564 const double radius = scale::decoration::RADIUS * aspect;
3565
3566 cairo_new_sub_path(context.cr_);
3567 cairo_line_to(context.cr_, 0, context.h_);
3568 cairo_arc(context.cr_, radius, radius, radius, M_PI, -M_PI * 0.5f);
3569 cairo_line_to(context.cr_, context.w_ - radius, 0);
3570 cairo_arc(context.cr_, context.w_ - radius, radius, radius, M_PI * 0.5f, 0);
3571 cairo_line_to(context.cr_, context.w_, context.h_);
3572 cairo_close_path(context.cr_);
3573
3574 cairo_fill(context.cr_);
3575
3576 cairo_restore(context.cr_);
3577}
3578
3536void UnityWindow::RenderText(CairoContext const& context, int x, int y, int width, int height)3579void UnityWindow::RenderText(CairoContext const& context, int x, int y, int width, int height)
3537{3580{
3538 panel::Style& style = panel::Style::Instance();3581 panel::Style& style = panel::Style::Instance();
@@ -3552,11 +3595,11 @@
3552 pango_cairo_context_set_resolution(pango_ctx, dpi / static_cast<float>(PANGO_SCALE));3595 pango_cairo_context_set_resolution(pango_ctx, dpi / static_cast<float>(PANGO_SCALE));
3553 pango_layout_context_changed(layout);3596 pango_layout_context_changed(layout);
35543597
3555 std::string const& win_title = WindowManager::Default()->GetWindowName(window->id());3598 decoration_title_ = WindowManager::Default()->GetWindowName(window->id());
3556 pango_layout_set_height(layout, height);3599 pango_layout_set_height(layout, height);
3557 pango_layout_set_width(layout, -1); //avoid wrap lines3600 pango_layout_set_width(layout, -1); //avoid wrap lines
3558 pango_layout_set_auto_dir(layout, false);3601 pango_layout_set_auto_dir(layout, false);
3559 pango_layout_set_text(layout, win_title.c_str(), -1);3602 pango_layout_set_text(layout, decoration_title_.c_str(), -1);
35603603
3561 /* update the size of the pango layout */3604 /* update the size of the pango layout */
3562 pango_cairo_update_layout(context.cr_, layout);3605 pango_cairo_update_layout(context.cr_, layout);
@@ -3578,8 +3621,8 @@
3578 pango_layout_get_extents(layout, nullptr, &lRect);3621 pango_layout_get_extents(layout, nullptr, &lRect);
3579 int text_width = lRect.width / PANGO_SCALE;3622 int text_width = lRect.width / PANGO_SCALE;
3580 int text_height = lRect.height / PANGO_SCALE;3623 int text_height = lRect.height / PANGO_SCALE;
3624 int text_space = width - x;
3581 y += (height - text_height) / 2.0f;3625 y += (height - text_height) / 2.0f;
3582 int text_space = width - x;
35833626
3584 if (text_width > text_space)3627 if (text_width > text_space)
3585 {3628 {
@@ -3606,49 +3649,19 @@
3606 gtk_style_context_restore(style_context);3649 gtk_style_context_restore(style_context);
3607}3650}
36083651
3609void UnityWindow::DrawWindowDecoration(GLWindowPaintAttrib const& attrib,3652void UnityWindow::BuildDecorationTexture()
3610 GLMatrix const& transform,
3611 unsigned int mask,
3612 bool highlighted,
3613 int x, int y, unsigned width, unsigned height)
3614{3653{
3615 // Paint a fake window decoration3654 if (!decoration_tex_.empty())
3616 CairoContext context(width, height);3655 return;
36173656
3618 cairo_save(context.cr_);3657 auto const& border_extents = window->border();
36193658
3620 // Draw window decoration based on gtk style3659 if (WindowManager::Default()->IsWindowDecorated(window->id()) && border_extents.top > 0)
3621 cairo_push_group(context.cr_);
3622 auto& style = panel::Style::Instance();
3623 gtk_render_background(style.GetStyleContext(), context.cr_, 0, 0, width, height);
3624 gtk_render_frame(style.GetStyleContext(), context.cr_, 0, 0, width, height);
3625 cairo_pop_group_to_source(context.cr_);
3626
3627 // Round window decoration top border
3628 const double aspect = ScaleWindow::get(window)->getCurrentPosition().scale;
3629 const double radius = 8.0 * aspect;
3630
3631 cairo_new_sub_path(context.cr_);
3632 cairo_line_to(context.cr_, 0, height);
3633 cairo_arc(context.cr_, radius, radius, radius, M_PI, -M_PI * 0.5f);
3634 cairo_line_to(context.cr_, width - radius, 0);
3635 cairo_arc(context.cr_, width - radius, radius, radius, M_PI * 0.5f, 0);
3636 cairo_line_to(context.cr_, width, height);
3637 cairo_close_path(context.cr_);
3638
3639 cairo_fill(context.cr_);
3640
3641 cairo_restore(context.cr_);
3642
3643 if (highlighted)
3644 {3660 {
3645 // Draw windows title3661 CairoContext context(window->borderRect().width(), border_extents.top);
3646 const float xText = SCALE_ITEMS_PADDING * 2 + SCALE_CLOSE_ICON_SIZE;3662 RenderDecoration(context);
3647 RenderText(context, xText, 0.0, width - SCALE_ITEMS_PADDING, height);3663 decoration_tex_ = context.texture_;
3648 }3664 }
3649
3650 mask |= PAINT_WINDOW_BLEND_MASK;
3651 DrawTexture(context.texture_, attrib, transform, mask, x, y);
3652}3665}
36533666
3654void UnityWindow::LoadCloseIcon(panel::WindowState state, GLTexture::List& texture)3667void UnityWindow::LoadCloseIcon(panel::WindowState state, GLTexture::List& texture)
@@ -3663,7 +3676,7 @@
3663 for (std::string const& file : files)3676 for (std::string const& file : files)
3664 {3677 {
3665 CompString file_name = file;3678 CompString file_name = file;
3666 CompSize size(SCALE_CLOSE_ICON_SIZE, SCALE_CLOSE_ICON_SIZE);3679 CompSize size(scale::decoration::CLOSE_SIZE, scale::decoration::CLOSE_SIZE);
3667 texture = GLTexture::readImageToTexture(file_name, plugin, size);3680 texture = GLTexture::readImageToTexture(file_name, plugin, size);
3668 if (!texture.empty())3681 if (!texture.empty())
3669 break;3682 break;
@@ -3678,7 +3691,7 @@
3678 suffix = "_pressed";3691 suffix = "_pressed";
36793692
3680 CompString file_name(PKGDATADIR"/close_dash" + suffix + ".png");3693 CompString file_name(PKGDATADIR"/close_dash" + suffix + ".png");
3681 CompSize size(SCALE_CLOSE_ICON_SIZE, SCALE_CLOSE_ICON_SIZE);3694 CompSize size(scale::decoration::CLOSE_SIZE, scale::decoration::CLOSE_SIZE);
3682 texture = GLTexture::readImageToTexture(file_name, plugin, size);3695 texture = GLTexture::readImageToTexture(file_name, plugin, size);
3683 }3696 }
3684}3697}
@@ -3697,6 +3710,13 @@
3697 close_pressed_tex_.clear();3710 close_pressed_tex_.clear();
3698}3711}
36993712
3713void UnityWindow::CleanupCachedTextures()
3714{
3715 decoration_tex_.clear();
3716 decoration_selected_tex_.clear();
3717 decoration_title_.clear();
3718}
3719
3700void UnityWindow::scalePaintDecoration(GLWindowPaintAttrib const& attrib,3720void UnityWindow::scalePaintDecoration(GLWindowPaintAttrib const& attrib,
3701 GLMatrix const& transform,3721 GLMatrix const& transform,
3702 CompRegion const& region,3722 CompRegion const& region,
@@ -3715,27 +3735,53 @@
3715 return;3735 return;
37163736
3717 auto const& scaled_geo = GetScaledGeometry();3737 auto const& scaled_geo = GetScaledGeometry();
3718 auto const& decoration_extents = window->border();
3719 auto const& pos = scale_win->getCurrentPosition();3738 auto const& pos = scale_win->getCurrentPosition();
37203739
3721 const bool highlighted = (ss->getSelectedWindow() == window->id());3740 const bool highlighted = (ss->getSelectedWindow() == window->id());
3722 int width = scaled_geo.width;
3723 int height = decoration_extents.top;
3724 int x = scaled_geo.x;3741 int x = scaled_geo.x;
3725 int y = scaled_geo.y;3742 int y = scaled_geo.y;
37263743
3744 mask |= PAINT_WINDOW_BLEND_MASK;
37273745
3728 // If window is not highlighted, we draw the decoration at scaled size
3729 if (!highlighted)3746 if (!highlighted)
3730 height *= pos.scale;3747 {
37313748 BuildDecorationTexture();
3732 DrawWindowDecoration(attrib, transform, mask, highlighted, x, y, width, height);3749 DrawTexture(decoration_tex_, attrib, transform, mask, x, y, pos.scale);
37333750 close_button_geo_.Set(0, 0, 0, 0);
3734 if (highlighted)3751 }
3735 {3752 else
3736 x += SCALE_ITEMS_PADDING;3753 {
3737 y += (height - SCALE_CLOSE_ICON_SIZE) / 2.0f;3754 auto const& decoration_extents = window->border();
3738 mask |= PAINT_WINDOW_BLEND_MASK;3755 int width = scaled_geo.width;
3756 int height = decoration_extents.top;
3757 bool redraw_decoration = true;
3758
3759 if (!decoration_selected_tex_.empty())
3760 {
3761 GLTexture* texture = decoration_selected_tex_.front();
3762
3763 if (texture->width() == width && texture->height() == height)
3764 {
3765 if (decoration_title_ == WindowManager::Default()->GetWindowName(window->id()))
3766 redraw_decoration = false;
3767 }
3768 }
3769
3770 if (redraw_decoration)
3771 {
3772 CairoContext context(width, height);
3773 RenderDecoration(context, pos.scale);
3774
3775 // Draw window title
3776 int text_x = scale::decoration::ITEMS_PADDING * 2 + scale::decoration::CLOSE_SIZE;
3777 RenderText(context, text_x, 0.0, width - scale::decoration::ITEMS_PADDING, height);
3778 decoration_selected_tex_ = context.texture_;
3779 }
3780
3781 DrawTexture(decoration_selected_tex_, attrib, transform, mask, x, y);
3782
3783 x += scale::decoration::ITEMS_PADDING;
3784 y += (height - scale::decoration::CLOSE_SIZE) / 2.0f;
37393785
3740 switch (close_icon_state_)3786 switch (close_icon_state_)
3741 {3787 {
@@ -3753,11 +3799,7 @@
3753 break;3799 break;
3754 }3800 }
37553801
3756 close_button_geo_.Set(x, y, SCALE_CLOSE_ICON_SIZE, SCALE_CLOSE_ICON_SIZE);3802 close_button_geo_.Set(x, y, scale::decoration::CLOSE_SIZE, scale::decoration::CLOSE_SIZE);
3757 }
3758 else if (!close_button_geo_.IsNull())
3759 {
3760 close_button_geo_.Set(0, 0, 0, 0);
3761 }3803 }
3762}3804}
37633805
@@ -3777,7 +3819,7 @@
3777 return nux::Geometry(x, y, width, height);3819 return nux::Geometry(x, y, width, height);
3778}3820}
37793821
3780void UnityWindow::OnInitiateSpreed()3822void UnityWindow::OnInitiateSpread()
3781{3823{
3782 close_icon_state_ = panel::WindowState::NORMAL;3824 close_icon_state_ = panel::WindowState::NORMAL;
3783 middle_clicked_ = false;3825 middle_clicked_ = false;
@@ -3790,13 +3832,15 @@
3790 wm->Decorate(xid);3832 wm->Decorate(xid);
3791}3833}
37923834
3793void UnityWindow::OnTerminateSpreed()3835void UnityWindow::OnTerminateSpread()
3794{3836{
3795 WindowManager *wm = WindowManager::Default();3837 WindowManager *wm = WindowManager::Default();
3796 Window xid = window->id();3838 Window xid = window->id();
37973839
3798 if (wm->IsWindowDecorated(xid) && wm->IsWindowMaximized(xid))3840 if (wm->IsWindowDecorated(xid) && wm->IsWindowMaximized(xid))
3799 wm->Undecorate(xid);3841 wm->Undecorate(xid);
3842
3843 CleanupCachedTextures();
3800}3844}
38013845
3802UnityWindow::~UnityWindow()3846UnityWindow::~UnityWindow()
38033847
=== modified file 'plugins/unityshell/src/unityshell.h'
--- plugins/unityshell/src/unityshell.h 2012-09-24 19:42:22 +0000
+++ plugins/unityshell/src/unityshell.h 2012-09-24 19:42:22 +0000
@@ -359,34 +359,22 @@
359359
360 nux::Geometry last_bound;360 nux::Geometry last_bound;
361361
362 void minimize ();362 void minimize();
363 void unminimize ();363 void unminimize();
364 bool minimized ();364 bool minimized();
365 bool focus ();365 bool focus();
366 void activate ();366 void activate();
367367
368 void updateFrameRegion (CompRegion &region);368 void updateFrameRegion(CompRegion &region);
369369
370 /* occlusion detection370 /* occlusion detection
371 * and window hiding */371 * and window hiding */
372 bool glPaint(const GLWindowPaintAttrib& attrib,372 bool glPaint(GLWindowPaintAttrib const&, GLMatrix const&, CompRegion const&, unsigned mask);
373 const GLMatrix& matrix,
374 const CompRegion& region,
375 unsigned int mask);
376373
377 /* basic window draw function */374 /* basic window draw function */
378 bool glDraw(const GLMatrix& matrix,375 bool glDraw(GLMatrix const&, GLWindowPaintAttrib const&, CompRegion const&, unsigned mask);
379 const GLWindowPaintAttrib& attrib,376
380 const CompRegion& region,377 void updateIconPos (int &wx, int &wy, int x, int y, float width, float height);
381 unsigned intmask);
382
383 void updateIconPos (int &wx,
384 int &wy,
385 int x,
386 int y,
387 float width,
388 float height);
389
390 void windowNotify(CompWindowNotify n);378 void windowNotify(CompWindowNotify n);
391 void moveNotify(int x, int y, bool immediate);379 void moveNotify(int x, int y, bool immediate);
392 void resizeNotify(int x, int y, int w, int h);380 void resizeNotify(int x, int y, int w, int h);
@@ -396,32 +384,26 @@
396 CompPoint tryNotIntersectUI(CompPoint& pos);384 CompPoint tryNotIntersectUI(CompPoint& pos);
397 nux::Geometry GetScaledGeometry();385 nux::Geometry GetScaledGeometry();
398386
399 void paintThumbnail (nux::Geometry const& bounding, float alpha);387 void paintThumbnail(nux::Geometry const& bounding, float alpha);
400388
401 void enterShowDesktop ();389 void enterShowDesktop();
402 void leaveShowDesktop ();390 void leaveShowDesktop();
403 bool HandleAnimations (unsigned int ms);391 bool HandleAnimations(unsigned int ms);
404392
405 bool handleEvent(XEvent *event);393 bool handleEvent(XEvent *event);
406394 void scalePaintDecoration(GLWindowPaintAttrib const&, GLMatrix const&, CompRegion const&, unsigned mask);
395
396 //! Emited when CompWindowNotifyBeforeDestroy is received
397 sigc::signal<void> being_destroyed;
398
399
400protected:
401 std::string GetName() const;
402 void AddProperties(GVariantBuilder* builder);
403
404private:
407 typedef compiz::CompizMinimizedWindowHandler<UnityScreen, UnityWindow>405 typedef compiz::CompizMinimizedWindowHandler<UnityScreen, UnityWindow>
408 UnityMinimizedHandler;406 UnityMinimizedHandler;
409 std::unique_ptr <UnityMinimizedHandler> mMinimizeHandler;
410 std::unique_ptr <ShowdesktopHandler> mShowdesktopHandler;
411
412 //! Emited when CompWindowNotifyBeforeDestroy is received
413 sigc::signal<void> being_destroyed;
414
415 void scalePaintDecoration(const GLWindowPaintAttrib &,
416 const GLMatrix &,
417 const CompRegion &,
418 unsigned int);
419
420protected:
421 std::string GetName() const;
422 void AddProperties(GVariantBuilder* builder);
423
424private:
425 struct CairoContext;407 struct CairoContext;
426408
427 void DoEnableFocus ();409 void DoEnableFocus ();
@@ -443,8 +425,8 @@
443 void DoShow ();425 void DoShow ();
444 void DoNotifyShown ();426 void DoNotifyShown ();
445427
446 void OnInitiateSpreed();428 void OnInitiateSpread();
447 void OnTerminateSpreed();429 void OnTerminateSpread();
448430
449 void DoAddDamage ();431 void DoAddDamage ();
450 ShowdesktopHandlerWindowInterface::PostPaintAction DoHandleAnimations (unsigned int ms);432 ShowdesktopHandlerWindowInterface::PostPaintAction DoHandleAnimations (unsigned int ms);
@@ -457,20 +439,28 @@
457439
458 compiz::WindowInputRemoverLock::Ptr GetInputRemover ();440 compiz::WindowInputRemoverLock::Ptr GetInputRemover ();
459441
460 void DrawWindowDecoration(GLWindowPaintAttrib const& attrib, GLMatrix const& transform,442 void RenderDecoration(CairoContext const&, double aspect = 1.0f);
461 unsigned int mask, bool highlighted,443 void RenderText(CairoContext const&, int x, int y, int width, int height);
462 int x, int y, unsigned width, unsigned height);444 void DrawTexture(GLTexture::List const& textures, GLWindowPaintAttrib const&,
463 void DrawTexture(GLTexture::List const& textures, GLWindowPaintAttrib const& attrib,445 GLMatrix const&, unsigned mask, int x, int y, double scale = 1.0f);
464 GLMatrix const& transform, unsigned int mask, int x, int y);
465 void RenderText(CairoContext const& context, int x, int y, int width, int height);
466446
447 void BuildDecorationTexture();
448 void CleanupCachedTextures();
467 static void SetupSharedTextures();449 static void SetupSharedTextures();
468 static void CleanupSharedTextures();450 static void CleanupSharedTextures();
469 static void LoadCloseIcon(panel::WindowState state, GLTexture::List& texture);451 static void LoadCloseIcon(panel::WindowState state, GLTexture::List& texture);
470452
453public:
454 std::unique_ptr <UnityMinimizedHandler> mMinimizeHandler;
455
456private:
457 std::unique_ptr <ShowdesktopHandler> mShowdesktopHandler;
471 static GLTexture::List close_normal_tex_;458 static GLTexture::List close_normal_tex_;
472 static GLTexture::List close_prelight_tex_;459 static GLTexture::List close_prelight_tex_;
473 static GLTexture::List close_pressed_tex_;460 static GLTexture::List close_pressed_tex_;
461 GLTexture::List decoration_tex_;
462 GLTexture::List decoration_selected_tex_;
463 std::string decoration_title_;
474 compiz::WindowInputRemoverLock::Weak input_remover_;464 compiz::WindowInputRemoverLock::Weak input_remover_;
475 panel::WindowState close_icon_state_;465 panel::WindowState close_icon_state_;
476 nux::Geometry close_button_geo_;466 nux::Geometry close_button_geo_;

Subscribers

People subscribed via source and target branches