| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_HEADS_UP_DISPLAY_LAYER_H_ | 5 #ifndef CC_LAYERS_HEADS_UP_DISPLAY_LAYER_H_ |
| 6 #define CC_LAYERS_HEADS_UP_DISPLAY_LAYER_H_ | 6 #define CC_LAYERS_HEADS_UP_DISPLAY_LAYER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "cc/base/cc_export.h" | 12 #include "cc/base/cc_export.h" |
| 13 #include "cc/layers/layer.h" | 13 #include "cc/layers/layer.h" |
| 14 #include "third_party/skia/include/core/SkRefCnt.h" |
| 14 #include "third_party/skia/include/core/SkTypeface.h" | 15 #include "third_party/skia/include/core/SkTypeface.h" |
| 15 | 16 |
| 16 namespace cc { | 17 namespace cc { |
| 17 | 18 |
| 18 namespace proto { | 19 namespace proto { |
| 19 class LayerNode; | 20 class LayerNode; |
| 20 } // namespace proto | 21 } // namespace proto |
| 21 | 22 |
| 22 class CC_EXPORT HeadsUpDisplayLayer : public Layer { | 23 class CC_EXPORT HeadsUpDisplayLayer : public Layer { |
| 23 public: | 24 public: |
| 24 static scoped_refptr<HeadsUpDisplayLayer> Create(); | 25 static scoped_refptr<HeadsUpDisplayLayer> Create(); |
| 25 | 26 |
| 26 void PrepareForCalculateDrawProperties( | 27 void PrepareForCalculateDrawProperties( |
| 27 const gfx::Size& device_viewport, float device_scale_factor); | 28 const gfx::Size& device_viewport, float device_scale_factor); |
| 28 | 29 |
| 29 std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; | 30 std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; |
| 30 | 31 |
| 31 void SetTypeForProtoSerialization(proto::LayerNode* proto) const override; | 32 void SetTypeForProtoSerialization(proto::LayerNode* proto) const override; |
| 32 | 33 |
| 33 // Layer overrides. | 34 // Layer overrides. |
| 34 void PushPropertiesTo(LayerImpl* layer) override; | 35 void PushPropertiesTo(LayerImpl* layer) override; |
| 35 | 36 |
| 36 protected: | 37 protected: |
| 37 HeadsUpDisplayLayer(); | 38 HeadsUpDisplayLayer(); |
| 38 bool HasDrawableContent() const override; | 39 bool HasDrawableContent() const override; |
| 39 | 40 |
| 40 private: | 41 private: |
| 41 ~HeadsUpDisplayLayer() override; | 42 ~HeadsUpDisplayLayer() override; |
| 42 | 43 |
| 43 skia::RefPtr<SkTypeface> typeface_; | 44 sk_sp<SkTypeface> typeface_; |
| 44 | 45 |
| 45 DISALLOW_COPY_AND_ASSIGN(HeadsUpDisplayLayer); | 46 DISALLOW_COPY_AND_ASSIGN(HeadsUpDisplayLayer); |
| 46 }; | 47 }; |
| 47 | 48 |
| 48 } // namespace cc | 49 } // namespace cc |
| 49 | 50 |
| 50 #endif // CC_LAYERS_HEADS_UP_DISPLAY_LAYER_H_ | 51 #endif // CC_LAYERS_HEADS_UP_DISPLAY_LAYER_H_ |
| OLD | NEW |