~apinheiro/unity/bug844927

« back to all changes in this revision

Viewing changes to plugins/unityshell/src/ResultRendererTile.cpp

  • Committer: Gord Allott
  • Date: 2011-09-08 11:08:57 UTC
  • mfrom: (1482.1.9 dash-speedups)
  • Revision ID: gord.allott@canonical.com-20110908110857-xs2sl4fcpcixz125
Merging in my branch that speeds up the dash even further, we now only render the results that are on the screen and only load the icons that are visible, reducing the memory footprint 

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
                                nux::Geometry& geometry,
76
76
                                int x_offset, int y_offset)
77
77
{
 
78
  TextureContainer* container = row.renderer<TextureContainer*>();
 
79
  if (container == nullptr)
 
80
    return;
 
81
 
78
82
  std::string row_text = row.name;
79
83
  std::string row_iconhint = row.icon_hint;
80
84
  PlacesStyle* style = PlacesStyle::GetDefault();
99
103
                       geometry.height,
100
104
                       col);
101
105
 
102
 
  TextureContainer* container = row.renderer<TextureContainer*>();
103
 
 
104
106
  if (container->blurred_icon)
105
107
  {
106
108
    GfxContext.QRP_1Tex(geometry.x + ((geometry.width - 58) / 2) - x_offset,
221
223
 
222
224
void ResultRendererTile::Preload(Result& row)
223
225
{
224
 
  row.set_renderer(new TextureContainer());
225
 
  LoadIcon(row);
226
 
  LoadText(row);
 
226
  if (row.renderer<TextureContainer*>() == nullptr)
 
227
  {
 
228
    row.set_renderer(new TextureContainer());
 
229
    LoadIcon(row);
 
230
    LoadText(row);
 
231
  }
227
232
}
228
233
 
229
234
void ResultRendererTile::Unload(Result& row)