Chromium Code Reviews| 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 #include "cc/layers/heads_up_display_layer.h" | 5 #include "cc/layers/heads_up_display_layer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
| 10 #include "cc/layers/heads_up_display_layer_impl.h" | 10 #include "cc/layers/heads_up_display_layer_impl.h" |
| 11 #include "cc/proto/layer.pb.h" | 11 #include "cc/proto/layer.pb.h" |
| 12 #include "cc/trees/layer_tree_host.h" | 12 #include "cc/trees/layer_tree_host.h" |
| 13 | 13 |
| 14 namespace cc { | 14 namespace cc { |
| 15 | 15 |
| 16 scoped_refptr<HeadsUpDisplayLayer> HeadsUpDisplayLayer::Create( | 16 scoped_refptr<HeadsUpDisplayLayer> HeadsUpDisplayLayer::Create() { |
| 17 const LayerSettings& settings) { | 17 return make_scoped_refptr(new HeadsUpDisplayLayer()); |
| 18 return make_scoped_refptr(new HeadsUpDisplayLayer(settings)); | |
| 19 } | 18 } |
| 20 | 19 |
| 21 HeadsUpDisplayLayer::HeadsUpDisplayLayer(const LayerSettings& settings) | 20 HeadsUpDisplayLayer::HeadsUpDisplayLayer() |
| 22 : Layer(settings), | 21 : Layer(), |
|
ajuma
2016/03/11 00:40:54
This line shouldn't be needed anymore. (And same c
loyso (OOO)
2016/03/11 03:26:57
Done.
| |
| 23 typeface_(skia::AdoptRef( | 22 typeface_(skia::AdoptRef( |
| 24 SkTypeface::CreateFromName("times new roman", SkTypeface::kNormal))) { | 23 SkTypeface::CreateFromName("times new roman", SkTypeface::kNormal))) { |
| 25 if (!typeface_) { | 24 if (!typeface_) { |
| 26 typeface_ = skia::AdoptRef( | 25 typeface_ = skia::AdoptRef( |
| 27 SkTypeface::CreateFromName("monospace", SkTypeface::kBold)); | 26 SkTypeface::CreateFromName("monospace", SkTypeface::kBold)); |
| 28 } | 27 } |
| 29 DCHECK(typeface_.get()); | 28 DCHECK(typeface_.get()); |
| 30 SetIsDrawable(true); | 29 SetIsDrawable(true); |
| 31 UpdateDrawsContent(HasDrawableContent()); | 30 UpdateDrawsContent(HasDrawableContent()); |
| 32 } | 31 } |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 77 void HeadsUpDisplayLayer::PushPropertiesTo(LayerImpl* layer) { | 76 void HeadsUpDisplayLayer::PushPropertiesTo(LayerImpl* layer) { |
| 78 Layer::PushPropertiesTo(layer); | 77 Layer::PushPropertiesTo(layer); |
| 79 TRACE_EVENT0("cc", "HeadsUpDisplayLayer::PushPropertiesTo"); | 78 TRACE_EVENT0("cc", "HeadsUpDisplayLayer::PushPropertiesTo"); |
| 80 HeadsUpDisplayLayerImpl* layer_impl = | 79 HeadsUpDisplayLayerImpl* layer_impl = |
| 81 static_cast<HeadsUpDisplayLayerImpl*>(layer); | 80 static_cast<HeadsUpDisplayLayerImpl*>(layer); |
| 82 | 81 |
| 83 layer_impl->SetHUDTypeface(typeface_); | 82 layer_impl->SetHUDTypeface(typeface_); |
| 84 } | 83 } |
| 85 | 84 |
| 86 } // namespace cc | 85 } // namespace cc |
| OLD | NEW |