summaryrefslogtreecommitdiff
diff options
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2014-08-26 00:09:51 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2014-08-26 00:09:51 +0200
commitca1a42f704ccfb11713d71034dc0884febed6c64 (patch)
treedc8af41c086f260479e23cef4707ab3d5c1d8059
parentae741ee59c7c03f263eb205dd38cbd2b8c7bcf82 (diff)
IconTextureSource: remember the count value, so that we redraw when values change
The emblem matrix needs to be updated accordingly. (bzr r3844.9.15)
-rw-r--r--unity-shared/IconRenderer.cpp4
-rw-r--r--unity-shared/IconTextureSource.cpp10
-rw-r--r--unity-shared/IconTextureSource.h6
3 files changed, 10 insertions, 10 deletions
diff --git a/unity-shared/IconRenderer.cpp b/unity-shared/IconRenderer.cpp
index ff661ef0c..57c034c79 100644
--- a/unity-shared/IconRenderer.cpp
+++ b/unity-shared/IconRenderer.cpp
@@ -366,7 +366,7 @@ void IconRenderer::PreprocessIcons(std::list<RenderArg>& args, nux::Geometry con
it->logical_center == launcher_icon->LastLogicalCenter(monitor) &&
it->rotation == launcher_icon->LastRotation(monitor) &&
it->skip == launcher_icon->WasSkipping(monitor) &&
- (launcher_icon->Count() != 0) == launcher_icon->HadCount(monitor) &&
+ launcher_icon->Count() == launcher_icon->LastCount(monitor) &&
(launcher_icon->Emblem() != nullptr) == launcher_icon->HadEmblem(monitor))
{
continue;
@@ -376,7 +376,7 @@ void IconRenderer::PreprocessIcons(std::list<RenderArg>& args, nux::Geometry con
launcher_icon->RememberRotation(monitor, it->rotation);
launcher_icon->RememberSkip(monitor, it->skip);
launcher_icon->RememberEmblem(monitor, launcher_icon->Emblem() != nullptr);
- launcher_icon->RememberCount(monitor, launcher_icon->Count() != 0);
+ launcher_icon->RememberCount(monitor, launcher_icon->Count());
float w = icon_size;
float h = icon_size;
diff --git a/unity-shared/IconTextureSource.cpp b/unity-shared/IconTextureSource.cpp
index 90af60f9c..4022ae062 100644
--- a/unity-shared/IconTextureSource.cpp
+++ b/unity-shared/IconTextureSource.cpp
@@ -34,7 +34,7 @@ namespace
IconTextureSource::IconTextureSource()
: skip_(RENDERERS_SIZE, false)
, had_emblem_(RENDERERS_SIZE, false)
- , had_count_(RENDERERS_SIZE, false)
+ , last_count_(RENDERERS_SIZE, 0)
, last_render_center_(RENDERERS_SIZE)
, last_logical_center_(RENDERERS_SIZE)
, last_rotation_(RENDERERS_SIZE)
@@ -92,14 +92,14 @@ bool IconTextureSource::HadEmblem(int monitor) const
return had_emblem_[monitor];
}
-void IconTextureSource::RememberCount(int monitor, bool has_count)
+void IconTextureSource::RememberCount(int monitor, unsigned count)
{
- had_count_[monitor] = has_count;
+ last_count_[monitor] = count;
}
-bool IconTextureSource::HadCount(int monitor) const
+unsigned IconTextureSource::LastCount(int monitor) const
{
- return had_count_[monitor];
+ return last_count_[monitor];
}
unsigned IconTextureSource::Count() const
diff --git a/unity-shared/IconTextureSource.h b/unity-shared/IconTextureSource.h
index 2f7132ac4..200b448ea 100644
--- a/unity-shared/IconTextureSource.h
+++ b/unity-shared/IconTextureSource.h
@@ -62,8 +62,8 @@ public:
void RememberEmblem(int monitor, bool has_emblem);
bool HadEmblem(int monitor) const;
- void RememberCount(int monitor, bool has_count);
- bool HadCount(int monitor) const;
+ void RememberCount(int monitor, unsigned count);
+ unsigned LastCount(int monitor) const;
virtual nux::Color BackgroundColor() const = 0;
virtual nux::Color GlowColor() = 0;
@@ -76,7 +76,7 @@ public:
private:
std::vector<bool> skip_;
std::vector<bool> had_emblem_;
- std::vector<bool> had_count_;
+ std::vector<unsigned> last_count_;
std::vector<nux::Point3> last_render_center_;
std::vector<nux::Point3> last_logical_center_;
std::vector<nux::Vector3> last_rotation_;