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 "components/exo/surface.h" | 5 #include "components/exo/surface.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 } | 138 } |
139 | 139 |
140 private: | 140 private: |
141 DISALLOW_COPY_AND_ASSIGN(CustomWindowTargeter); | 141 DISALLOW_COPY_AND_ASSIGN(CustomWindowTargeter); |
142 }; | 142 }; |
143 | 143 |
144 void SatisfyCallback(cc::SurfaceManager* manager, | 144 void SatisfyCallback(cc::SurfaceManager* manager, |
145 const cc::SurfaceSequence& sequence) { | 145 const cc::SurfaceSequence& sequence) { |
146 std::vector<uint32_t> sequences; | 146 std::vector<uint32_t> sequences; |
147 sequences.push_back(sequence.sequence); | 147 sequences.push_back(sequence.sequence); |
148 manager->DidSatisfySequences(sequence.id_namespace, &sequences); | 148 manager->DidSatisfySequences(sequence.client_id, &sequences); |
149 } | 149 } |
150 | 150 |
151 void RequireCallback(cc::SurfaceManager* manager, | 151 void RequireCallback(cc::SurfaceManager* manager, |
152 const cc::SurfaceId& id, | 152 const cc::SurfaceId& id, |
153 const cc::SurfaceSequence& sequence) { | 153 const cc::SurfaceSequence& sequence) { |
154 cc::Surface* surface = manager->GetSurfaceForId(id); | 154 cc::Surface* surface = manager->GetSurfaceForId(id); |
155 if (!surface) { | 155 if (!surface) { |
156 LOG(ERROR) << "Attempting to require callback on nonexistent surface"; | 156 LOG(ERROR) << "Attempting to require callback on nonexistent surface"; |
157 return; | 157 return; |
158 } | 158 } |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 // ui::LayerOwnerDelegate overrides: | 603 // ui::LayerOwnerDelegate overrides: |
604 | 604 |
605 void Surface::OnLayerRecreated(ui::Layer* old_layer, ui::Layer* new_layer) { | 605 void Surface::OnLayerRecreated(ui::Layer* old_layer, ui::Layer* new_layer) { |
606 if (!current_buffer_.buffer()) | 606 if (!current_buffer_.buffer()) |
607 return; | 607 return; |
608 | 608 |
609 // TODO(reveman): Give the client a chance to provide new contents. | 609 // TODO(reveman): Give the client a chance to provide new contents. |
610 SetSurfaceLayerContents(new_layer); | 610 SetSurfaceLayerContents(new_layer); |
611 } | 611 } |
612 | 612 |
613 void Surface::WillDraw(cc::SurfaceId id) { | 613 void Surface::WillDraw(const cc::SurfaceId& id) { |
614 while (!active_frame_callbacks_.empty()) { | 614 while (!active_frame_callbacks_.empty()) { |
615 active_frame_callbacks_.front().Run(base::TimeTicks::Now()); | 615 active_frame_callbacks_.front().Run(base::TimeTicks::Now()); |
616 active_frame_callbacks_.pop_front(); | 616 active_frame_callbacks_.pop_front(); |
617 } | 617 } |
618 } | 618 } |
619 | 619 |
620 void Surface::CheckIfSurfaceHierarchyNeedsCommitToNewSurfaces() { | 620 void Surface::CheckIfSurfaceHierarchyNeedsCommitToNewSurfaces() { |
621 if (HasLayerHierarchyChanged()) | 621 if (HasLayerHierarchyChanged()) |
622 SetSurfaceHierarchyNeedsCommitToNewSurfaces(); | 622 SetSurfaceHierarchyNeedsCommitToNewSurfaces(); |
623 } | 623 } |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 | 834 |
835 int64_t Surface::GetPropertyInternal(const void* key, | 835 int64_t Surface::GetPropertyInternal(const void* key, |
836 int64_t default_value) const { | 836 int64_t default_value) const { |
837 std::map<const void*, Value>::const_iterator iter = prop_map_.find(key); | 837 std::map<const void*, Value>::const_iterator iter = prop_map_.find(key); |
838 if (iter == prop_map_.end()) | 838 if (iter == prop_map_.end()) |
839 return default_value; | 839 return default_value; |
840 return iter->second.value; | 840 return iter->second.value; |
841 } | 841 } |
842 | 842 |
843 } // namespace exo | 843 } // namespace exo |
OLD | NEW |