| 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 20 matching lines...) Expand all Loading... |
| 31 ContentLayerClient* client_; | 31 ContentLayerClient* client_; |
| 32 | 32 |
| 33 DISALLOW_COPY_AND_ASSIGN(ContentLayerPainter); | 33 DISALLOW_COPY_AND_ASSIGN(ContentLayerPainter); |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 // A layer that renders its contents into an SkCanvas. | 36 // A layer that renders its contents into an SkCanvas. |
| 37 class CC_EXPORT ContentLayer : public TiledLayer { | 37 class CC_EXPORT ContentLayer : public TiledLayer { |
| 38 public: | 38 public: |
| 39 static scoped_refptr<ContentLayer> Create(ContentLayerClient* client); | 39 static scoped_refptr<ContentLayer> Create(ContentLayerClient* client); |
| 40 | 40 |
| 41 void ClearClient() { client_ = NULL; } | 41 void ClearClient(); |
| 42 | 42 |
| 43 virtual bool DrawsContent() const OVERRIDE; | |
| 44 virtual void SetLayerTreeHost(LayerTreeHost* layer_tree_host) OVERRIDE; | 43 virtual void SetLayerTreeHost(LayerTreeHost* layer_tree_host) OVERRIDE; |
| 45 virtual void SetTexturePriorities(const PriorityCalculator& priority_calc) | 44 virtual void SetTexturePriorities(const PriorityCalculator& priority_calc) |
| 46 OVERRIDE; | 45 OVERRIDE; |
| 47 virtual bool Update(ResourceUpdateQueue* queue, | 46 virtual bool Update(ResourceUpdateQueue* queue, |
| 48 const OcclusionTracker<Layer>* occlusion) OVERRIDE; | 47 const OcclusionTracker<Layer>* occlusion) OVERRIDE; |
| 49 virtual bool NeedMoreUpdates() OVERRIDE; | 48 virtual bool NeedMoreUpdates() OVERRIDE; |
| 50 | 49 |
| 51 virtual void SetContentsOpaque(bool contents_opaque) OVERRIDE; | 50 virtual void SetContentsOpaque(bool contents_opaque) OVERRIDE; |
| 52 | 51 |
| 53 virtual bool SupportsLCDText() const OVERRIDE; | 52 virtual bool SupportsLCDText() const OVERRIDE; |
| 54 | 53 |
| 55 virtual skia::RefPtr<SkPicture> GetPicture() const OVERRIDE; | 54 virtual skia::RefPtr<SkPicture> GetPicture() const OVERRIDE; |
| 56 | 55 |
| 57 virtual void OnOutputSurfaceCreated() OVERRIDE; | 56 virtual void OnOutputSurfaceCreated() OVERRIDE; |
| 58 | 57 |
| 59 protected: | 58 protected: |
| 60 explicit ContentLayer(ContentLayerClient* client); | 59 explicit ContentLayer(ContentLayerClient* client); |
| 61 virtual ~ContentLayer(); | 60 virtual ~ContentLayer(); |
| 62 | 61 |
| 62 virtual bool HasDrawableContent() const OVERRIDE; |
| 63 |
| 63 // TiledLayer implementation. | 64 // TiledLayer implementation. |
| 64 virtual LayerUpdater* Updater() const OVERRIDE; | 65 virtual LayerUpdater* Updater() const OVERRIDE; |
| 65 | 66 |
| 66 private: | 67 private: |
| 67 // TiledLayer implementation. | 68 // TiledLayer implementation. |
| 68 virtual void CreateUpdaterIfNeeded() OVERRIDE; | 69 virtual void CreateUpdaterIfNeeded() OVERRIDE; |
| 69 | 70 |
| 70 void UpdateCanUseLCDText(); | 71 void UpdateCanUseLCDText(); |
| 71 | 72 |
| 72 ContentLayerClient* client_; | 73 ContentLayerClient* client_; |
| 73 scoped_refptr<ContentLayerUpdater> updater_; | 74 scoped_refptr<ContentLayerUpdater> updater_; |
| 74 bool can_use_lcd_text_last_frame_; | 75 bool can_use_lcd_text_last_frame_; |
| 75 | 76 |
| 76 DISALLOW_COPY_AND_ASSIGN(ContentLayer); | 77 DISALLOW_COPY_AND_ASSIGN(ContentLayer); |
| 77 }; | 78 }; |
| 78 | 79 |
| 79 } // namespace cc | 80 } // namespace cc |
| 80 #endif // CC_LAYERS_CONTENT_LAYER_H_ | 81 #endif // CC_LAYERS_CONTENT_LAYER_H_ |
| OLD | NEW |