summaryrefslogtreecommitdiffstats
path: root/cc/layers/layer_lists.h
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-18 21:37:23 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-18 21:37:23 +0000
commit989386c3e4c2e35fa4cf0d41febd1751e9afa3b3 (patch)
tree4869c1c6d2c4233ba654faf7b311c6698d6f1692 /cc/layers/layer_lists.h
parent909f5c42b086a8388abbee04049e0f44091fef6d (diff)
downloadchromium_src-989386c3e4c2e35fa4cf0d41febd1751e9afa3b3.zip
chromium_src-989386c3e4c2e35fa4cf0d41febd1751e9afa3b3.tar.gz
chromium_src-989386c3e4c2e35fa4cf0d41febd1751e9afa3b3.tar.bz2
cc: Clean up the RenderSurface objects in the RenderSurfaceLayerList
When the RenderSurfaceLayerList is cleared, we need to also destroy the RenderSurface objects. Create a RenderSurfaceLayerList subclass of LayerList which does this cleanup in a safe/scoped way, and use that in the public API for LayerTreeHostCommon. R=earthdok, enne BUG=259902 Review URL: https://chromiumcodereview.appspot.com/19236002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212437 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layers/layer_lists.h')
-rw-r--r--cc/layers/layer_lists.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/cc/layers/layer_lists.h b/cc/layers/layer_lists.h
index 83ef5fd..24a9c3c 100644
--- a/cc/layers/layer_lists.h
+++ b/cc/layers/layer_lists.h
@@ -8,6 +8,7 @@
#include <vector>
#include "base/memory/ref_counted.h"
+#include "cc/base/cc_export.h"
#include "cc/base/scoped_ptr_vector.h"
namespace cc {
@@ -19,6 +20,29 @@ typedef std::vector<scoped_refptr<Layer> > LayerList;
typedef ScopedPtrVector<LayerImpl> OwnedLayerImplList;
typedef std::vector<LayerImpl*> LayerImplList;
+class CC_EXPORT RenderSurfaceLayerList {
+ public:
+ RenderSurfaceLayerList();
+ ~RenderSurfaceLayerList();
+
+ Layer* at(size_t i) const;
+ void pop_back();
+ void push_back(const scoped_refptr<Layer>& layer);
+ Layer* back();
+ size_t size() const;
+ bool empty() const { return size() == 0u; }
+ LayerList::iterator begin();
+ LayerList::iterator end();
+ LayerList::const_iterator begin() const;
+ LayerList::const_iterator end() const;
+ void clear();
+
+ private:
+ LayerList list_;
+
+ DISALLOW_COPY_AND_ASSIGN(RenderSurfaceLayerList);
+};
+
} // namespace cc
#endif // CC_LAYERS_LAYER_LISTS_H_