| OLD | NEW |
| 1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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_LAYERS_CONTENT_LAYER_H_ | 5 #ifndef CC_LAYERS_CONTENT_LAYER_H_ |
| 6 #define CC_LAYERS_CONTENT_LAYER_H_ | 6 #define CC_LAYERS_CONTENT_LAYER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "cc/base/cc_export.h" | 9 #include "cc/base/cc_export.h" |
| 10 #include "cc/layers/tiled_layer.h" | 10 #include "cc/layers/tiled_layer.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 explicit ContentLayerPainter(ContentLayerClient* client); | 27 explicit ContentLayerPainter(ContentLayerClient* client); |
| 28 | 28 |
| 29 ContentLayerClient* client_; | 29 ContentLayerClient* client_; |
| 30 | 30 |
| 31 DISALLOW_COPY_AND_ASSIGN(ContentLayerPainter); | 31 DISALLOW_COPY_AND_ASSIGN(ContentLayerPainter); |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 // A layer that renders its contents into an SkCanvas. | 34 // A layer that renders its contents into an SkCanvas. |
| 35 class CC_EXPORT ContentLayer : public TiledLayer { | 35 class CC_EXPORT ContentLayer : public TiledLayer { |
| 36 public: | 36 public: |
| 37 static scoped_refptr<ContentLayer> Create(ContentLayerClient* client); | 37 static scoped_refptr<ContentLayer> Create(const LayerSettings& settings, |
| 38 ContentLayerClient* client); |
| 38 | 39 |
| 39 void ClearClient(); | 40 void ClearClient(); |
| 40 | 41 |
| 41 void SetLayerTreeHost(LayerTreeHost* layer_tree_host) override; | 42 void SetLayerTreeHost(LayerTreeHost* layer_tree_host) override; |
| 42 void SetTexturePriorities(const PriorityCalculator& priority_calc) override; | 43 void SetTexturePriorities(const PriorityCalculator& priority_calc) override; |
| 43 bool Update(ResourceUpdateQueue* queue, | 44 bool Update(ResourceUpdateQueue* queue, |
| 44 const OcclusionTracker<Layer>* occlusion) override; | 45 const OcclusionTracker<Layer>* occlusion) override; |
| 45 bool NeedMoreUpdates() override; | 46 bool NeedMoreUpdates() override; |
| 46 | 47 |
| 47 void SetContentsOpaque(bool contents_opaque) override; | 48 void SetContentsOpaque(bool contents_opaque) override; |
| 48 | 49 |
| 49 skia::RefPtr<SkPicture> GetPicture() const override; | 50 skia::RefPtr<SkPicture> GetPicture() const override; |
| 50 | 51 |
| 51 void OnOutputSurfaceCreated() override; | 52 void OnOutputSurfaceCreated() override; |
| 52 | 53 |
| 53 protected: | 54 protected: |
| 54 explicit ContentLayer(ContentLayerClient* client); | 55 ContentLayer(const LayerSettings& settings, ContentLayerClient* client); |
| 55 ~ContentLayer() override; | 56 ~ContentLayer() override; |
| 56 | 57 |
| 57 bool HasDrawableContent() const override; | 58 bool HasDrawableContent() const override; |
| 58 | 59 |
| 59 // TiledLayer implementation. | 60 // TiledLayer implementation. |
| 60 LayerUpdater* Updater() const override; | 61 LayerUpdater* Updater() const override; |
| 61 | 62 |
| 62 private: | 63 private: |
| 63 // TiledLayer implementation. | 64 // TiledLayer implementation. |
| 64 void CreateUpdaterIfNeeded() override; | 65 void CreateUpdaterIfNeeded() override; |
| 65 | 66 |
| 66 ContentLayerClient* client_; | 67 ContentLayerClient* client_; |
| 67 scoped_refptr<ContentLayerUpdater> updater_; | 68 scoped_refptr<ContentLayerUpdater> updater_; |
| 68 | 69 |
| 69 DISALLOW_COPY_AND_ASSIGN(ContentLayer); | 70 DISALLOW_COPY_AND_ASSIGN(ContentLayer); |
| 70 }; | 71 }; |
| 71 | 72 |
| 72 } // namespace cc | 73 } // namespace cc |
| 73 #endif // CC_LAYERS_CONTENT_LAYER_H_ | 74 #endif // CC_LAYERS_CONTENT_LAYER_H_ |
| OLD | NEW |