summaryrefslogtreecommitdiff
path: root/dash/previews
diff options
authorNick Dedekind <nicholas.dedekind@gmail.com>2012-08-07 10:10:29 +0100
committerNick Dedekind <nicholas.dedekind@gmail.com>2012-08-07 10:10:29 +0100
commitcf66373872ec9b5a90547cbad5baf1326021ea11 (patch)
tree0953cfac44b7eba509d7f07f9072313da4273c1b /dash/previews
parent81b4dee73f9587779aa7e889c247076dfbb90d16 (diff)
removed dependence ofpreview animation on idle source.
(bzr r2419.4.37)
Diffstat (limited to 'dash/previews')
-rw-r--r--dash/previews/PreviewContainer.cpp44
-rw-r--r--dash/previews/PreviewContainer.h3
2 files changed, 27 insertions, 20 deletions
diff --git a/dash/previews/PreviewContainer.cpp b/dash/previews/PreviewContainer.cpp
index 95229ad5c..129ce5a04 100644
--- a/dash/previews/PreviewContainer.cpp
+++ b/dash/previews/PreviewContainer.cpp
@@ -303,6 +303,23 @@ void PreviewContainer::SetupViews()
});
}
+void PreviewContainer::ProcessDraw(nux::GraphicsEngine& gfx_engine, bool force_draw)
+{
+ bool bNextQueue = AnimationInProgress();
+ // rely on the compiz event loop to come back to us in a nice throttling
+ if (!bNextQueue && content_layout_ && content_layout_->IsAnimating())
+ {
+ content_layout_->UpdateAnimationProgress(1.0f, 1.0f);
+ }
+
+ View::ProcessDraw(gfx_engine, force_draw);
+
+ if (bNextQueue)
+ {
+ QueueAnimation();
+ }
+}
+
void PreviewContainer::Draw(nux::GraphicsEngine& gfx_engine, bool force_draw)
{
}
@@ -315,16 +332,6 @@ void PreviewContainer::DrawContent(nux::GraphicsEngine& gfx_engine, bool force_d
// Paint using ProcessDraw2. ProcessDraw is overrided by empty impl so we can control z order.
if (content_layout_)
{
- // rely on the compiz event loop to come back to us in a nice throttling
- if (AnimationInProgress())
- {
- QueueAnimation();
- }
- else if (content_layout_ && content_layout_->IsAnimating())
- {
- content_layout_->UpdateAnimationProgress(1.0f, 1.0f);
- }
-
content_layout_->ProcessDraw2(gfx_engine, force_draw);
}
if (GetCompositionLayout())
@@ -380,15 +387,15 @@ float PreviewContainer::GetSwipeAnimationProgress(struct timespec const& current
void PreviewContainer::QueueAnimation()
{
- if (!idle_)
- {
- idle_.reset(new glib::Idle(sigc::mem_fun(this, &PreviewContainer::Iteration), glib::Source::Priority::DEFAULT));
- }
-}
+// if (!idle_)
+// {
+// idle_.reset(new glib::Idle(sigc::mem_fun(this, &PreviewContainer::Iteration), glib::Source::Priority::DEFAULT));
+// }
+// }
-bool PreviewContainer::Iteration()
-{
- idle_.reset();
+// bool PreviewContainer::Iteration()
+// {
+ // idle_.reset();
timespec current;
clock_gettime(CLOCK_MONOTONIC, &current);
@@ -397,7 +404,6 @@ bool PreviewContainer::Iteration()
last_progress_time_ = current;
QueueDraw();
- return false;
}
bool PreviewContainer::AcceptKeyNavFocus()
diff --git a/dash/previews/PreviewContainer.h b/dash/previews/PreviewContainer.h
index af0bd98ea..e0d502b55 100644
--- a/dash/previews/PreviewContainer.h
+++ b/dash/previews/PreviewContainer.h
@@ -75,6 +75,8 @@ public:
sigc::signal<void> request_close;
bool AcceptKeyNavFocus();
+
+ void ProcessDraw(nux::GraphicsEngine& gfx_engine, bool force_draw);
protected:
void Draw(nux::GraphicsEngine& gfx_engine, bool force_draw);
@@ -92,7 +94,6 @@ private:
float GetSwipeAnimationProgress(struct timespec const& current) const;
void QueueAnimation();
- bool Iteration();
private:
// View related