Change CelList and LayerList from std::list to std::vector

This change gives us an huge performance improvement to paint the
Timeline widget.
This commit is contained in:
David Capello 2015-09-14 17:37:21 -03:00
parent 11c70ab522
commit 510a686020
3 changed files with 11 additions and 11 deletions

View File

@ -1,5 +1,5 @@
// Aseprite Document Library
// Copyright (c) 2001-2014 David Capello
// Copyright (c) 2001-2015 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
@ -8,15 +8,15 @@
#define DOC_CEL_LIST_H_INCLUDED
#pragma once
#include <list>
#include <vector>
namespace doc {
class Cel;
typedef std::list<Cel*> CelList;
typedef std::list<Cel*>::iterator CelIterator;
typedef std::list<Cel*>::const_iterator CelConstIterator;
typedef std::vector<Cel*> CelList;
typedef CelList::iterator CelIterator;
typedef CelList::const_iterator CelConstIterator;
} // namespace doc

View File

@ -316,7 +316,7 @@ void LayerFolder::stackLayer(Layer* layer, Layer* after)
m_layers.insert(after_it, layer);
}
else
m_layers.push_front(layer);
m_layers.insert(m_layers.begin(), layer);
}
void LayerFolder::displaceFrames(frame_t fromThis, frame_t delta)

View File

@ -1,5 +1,5 @@
// Aseprite Document Library
// Copyright (c) 2001-2014 David Capello
// Copyright (c) 2001-2015 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
@ -8,15 +8,15 @@
#define DOC_LAYER_LIST_H_INCLUDED
#pragma once
#include <list>
#include <vector>
namespace doc {
class Layer;
typedef std::list<Layer*> LayerList;
typedef std::list<Layer*>::iterator LayerIterator;
typedef std::list<Layer*>::const_iterator LayerConstIterator;
typedef std::vector<Layer*> LayerList;
typedef LayerList::iterator LayerIterator;
typedef LayerList::const_iterator LayerConstIterator;
} // namespace doc