OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "services/gfx/compositor/renderer_state.h" | 5 #include "services/gfx/compositor/renderer_state.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 | 9 |
10 namespace compositor { | 10 namespace compositor { |
(...skipping 12 matching lines...) Expand all Loading... |
23 !root_scene_viewport_.Equals(viewport)) { | 23 !root_scene_viewport_.Equals(viewport)) { |
24 root_scene_ = scene; | 24 root_scene_ = scene; |
25 root_scene_version_ = version; | 25 root_scene_version_ = version; |
26 root_scene_viewport_ = viewport; | 26 root_scene_viewport_ = viewport; |
27 SetSnapshot(nullptr); | 27 SetSnapshot(nullptr); |
28 return true; | 28 return true; |
29 } | 29 } |
30 return false; | 30 return false; |
31 } | 31 } |
32 | 32 |
33 bool RendererState::ResetRootScene() { | 33 bool RendererState::ClearRootScene() { |
34 if (root_scene_) { | 34 if (root_scene_) { |
35 root_scene_ = nullptr; | 35 root_scene_ = nullptr; |
36 SetSnapshot(nullptr); | 36 SetSnapshot(nullptr); |
37 return true; | 37 return true; |
38 } | 38 } |
39 return false; | 39 return false; |
40 } | 40 } |
41 | 41 |
42 void RendererState::SetSnapshot(const scoped_refptr<const Snapshot>& snapshot) { | 42 void RendererState::SetSnapshot(const scoped_refptr<const Snapshot>& snapshot) { |
43 current_snapshot_ = snapshot; | 43 current_snapshot_ = snapshot; |
(...skipping 10 matching lines...) Expand all Loading... |
54 return formatted_label_cache_; | 54 return formatted_label_cache_; |
55 } | 55 } |
56 | 56 |
57 std::ostream& operator<<(std::ostream& os, RendererState* renderer_state) { | 57 std::ostream& operator<<(std::ostream& os, RendererState* renderer_state) { |
58 if (!renderer_state) | 58 if (!renderer_state) |
59 return os << "null"; | 59 return os << "null"; |
60 return os << renderer_state->FormattedLabel(); | 60 return os << renderer_state->FormattedLabel(); |
61 } | 61 } |
62 | 62 |
63 } // namespace compositor | 63 } // namespace compositor |
OLD | NEW |