blob: 76b71b132a04b4e10f521a18c65c56deb510ec52 [file] [log] [blame]
[email protected]d98c0242012-11-08 06:22:351// Copyright 2012 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CC_PICTURE_LAYER_IMPL_H_
6#define CC_PICTURE_LAYER_IMPL_H_
7
8#include "cc/layer_impl.h"
[email protected]9b18c102012-11-15 19:57:039#include "cc/picture_layer_tiling.h"
[email protected]d98c0242012-11-08 06:22:3510#include "cc/picture_pile.h"
[email protected]9b18c102012-11-15 19:57:0311#include "cc/scoped_ptr_vector.h"
[email protected]d98c0242012-11-08 06:22:3512
13namespace cc {
14
[email protected]3621e182012-11-09 22:37:0915struct AppendQuadsData;
16class QuadSink;
17
[email protected]9b18c102012-11-15 19:57:0318class CC_EXPORT PictureLayerImpl : public LayerImpl,
19 public PictureLayerTilingClient {
[email protected]d98c0242012-11-08 06:22:3520public:
21 static scoped_ptr<PictureLayerImpl> create(int id)
22 {
23 return make_scoped_ptr(new PictureLayerImpl(id));
24 }
25 virtual ~PictureLayerImpl();
26
[email protected]3621e182012-11-09 22:37:0927 // LayerImpl overrides.
28 virtual const char* layerTypeAsString() const OVERRIDE;
29 virtual void appendQuads(QuadSink&, AppendQuadsData&) OVERRIDE;
30 virtual void dumpLayerProperties(std::string*, int indent) const OVERRIDE;
31
[email protected]9b18c102012-11-15 19:57:0332 // PictureLayerTilingClient overrides.
33 virtual scoped_refptr<Tile> CreateTile(PictureLayerTiling*,
34 gfx::Rect) OVERRIDE;
35
36 // PushPropertiesTo active tree => pending tree
37 void SyncFromActiveLayer(const PictureLayerImpl* other);
38
39 // Called post-calcDraw.
40 void Update();
41
[email protected]d98c0242012-11-08 06:22:3542protected:
43 PictureLayerImpl(int id);
44
[email protected]9b18c102012-11-15 19:57:0345 ScopedPtrVector<PictureLayerTiling> tilings_;
[email protected]d98c0242012-11-08 06:22:3546 PicturePile pile_;
47
48 friend class PictureLayer;
49 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl);
50};
51
52}
53
54#endif // CC_PICTURE_LAYER_IMPL_H_