OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CC_TILED_LAYER_IMPL_H_ | 5 #ifndef CC_TILED_LAYER_IMPL_H_ |
6 #define CC_TILED_LAYER_IMPL_H_ | 6 #define CC_TILED_LAYER_IMPL_H_ |
7 | 7 |
8 #include "cc/cc_export.h" | 8 #include "cc/cc_export.h" |
9 #include "cc/layer_impl.h" | 9 #include "cc/layer_impl.h" |
10 | 10 |
11 namespace cc { | 11 namespace cc { |
12 | 12 |
13 class LayerTilingData; | 13 class LayerTilingData; |
14 class DrawableTile; | 14 class DrawableTile; |
15 | 15 |
16 class CC_EXPORT TiledLayerImpl : public LayerImpl { | 16 class CC_EXPORT TiledLayerImpl : public LayerImpl { |
17 public: | 17 public: |
18 static scoped_ptr<TiledLayerImpl> create(int id) | 18 static scoped_ptr<TiledLayerImpl> create(LayerTreeHostImpl* hostImpl, int id
) |
19 { | 19 { |
20 return make_scoped_ptr(new TiledLayerImpl(id)); | 20 return make_scoped_ptr(new TiledLayerImpl(hostImpl, id)); |
21 } | 21 } |
22 virtual ~TiledLayerImpl(); | 22 virtual ~TiledLayerImpl(); |
23 | 23 |
24 virtual void appendQuads(QuadSink&, AppendQuadsData&) OVERRIDE; | 24 virtual void appendQuads(QuadSink&, AppendQuadsData&) OVERRIDE; |
25 | 25 |
26 virtual ResourceProvider::ResourceId contentsResourceId() const OVERRIDE; | 26 virtual ResourceProvider::ResourceId contentsResourceId() const OVERRIDE; |
27 | 27 |
28 virtual void dumpLayerProperties(std::string*, int indent) const OVERRIDE; | 28 virtual void dumpLayerProperties(std::string*, int indent) const OVERRIDE; |
29 | 29 |
30 void setSkipsDraw(bool skipsDraw) { m_skipsDraw = skipsDraw; } | 30 void setSkipsDraw(bool skipsDraw) { m_skipsDraw = skipsDraw; } |
31 void setTilingData(const LayerTilingData& tiler); | 31 void setTilingData(const LayerTilingData& tiler); |
32 void pushTileProperties(int, int, ResourceProvider::ResourceId, const gfx::R
ect& opaqueRect, bool contentsSwizzled); | 32 void pushTileProperties(int, int, ResourceProvider::ResourceId, const gfx::R
ect& opaqueRect, bool contentsSwizzled); |
33 void pushInvalidTile(int, int); | 33 void pushInvalidTile(int, int); |
34 | 34 |
35 virtual Region visibleContentOpaqueRegion() const OVERRIDE; | 35 virtual Region visibleContentOpaqueRegion() const OVERRIDE; |
36 virtual void didLoseOutputSurface() OVERRIDE; | 36 virtual void didLoseOutputSurface() OVERRIDE; |
37 | 37 |
38 protected: | 38 protected: |
39 explicit TiledLayerImpl(int id); | 39 TiledLayerImpl(LayerTreeHostImpl* hostImpl, int id); |
40 // Exposed for testing. | 40 // Exposed for testing. |
41 bool hasTileAt(int, int) const; | 41 bool hasTileAt(int, int) const; |
42 bool hasResourceIdForTileAt(int, int) const; | 42 bool hasResourceIdForTileAt(int, int) const; |
43 | 43 |
44 virtual void getDebugBorderProperties(SkColor*, float* width) const OVERRIDE
; | 44 virtual void getDebugBorderProperties(SkColor*, float* width) const OVERRIDE
; |
45 | 45 |
46 private: | 46 private: |
47 | 47 |
48 virtual const char* layerTypeAsString() const OVERRIDE; | 48 virtual const char* layerTypeAsString() const OVERRIDE; |
49 | 49 |
50 DrawableTile* tileAt(int, int) const; | 50 DrawableTile* tileAt(int, int) const; |
51 DrawableTile* createTile(int, int); | 51 DrawableTile* createTile(int, int); |
52 | 52 |
53 bool m_skipsDraw; | 53 bool m_skipsDraw; |
54 | 54 |
55 scoped_ptr<LayerTilingData> m_tiler; | 55 scoped_ptr<LayerTilingData> m_tiler; |
56 }; | 56 }; |
57 | 57 |
58 } | 58 } |
59 | 59 |
60 #endif // CC_TILED_LAYER_IMPL_H_ | 60 #endif // CC_TILED_LAYER_IMPL_H_ |
OLD | NEW |