test_latest_local_surface_id_lookup_delegate.cc 920 B

123456789101112131415161718192021222324252627
  1. // Copyright 2018 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "components/viz/test/test_latest_local_surface_id_lookup_delegate.h"
  5. namespace viz {
  6. TestLatestLocalSurfaceIdLookupDelegate::
  7. TestLatestLocalSurfaceIdLookupDelegate() = default;
  8. TestLatestLocalSurfaceIdLookupDelegate::
  9. ~TestLatestLocalSurfaceIdLookupDelegate() = default;
  10. LocalSurfaceId TestLatestLocalSurfaceIdLookupDelegate::GetSurfaceAtAggregation(
  11. const FrameSinkId& frame_sink_id) const {
  12. auto it = surface_id_map_.find(frame_sink_id);
  13. if (it == surface_id_map_.end())
  14. return LocalSurfaceId();
  15. return it->second;
  16. }
  17. void TestLatestLocalSurfaceIdLookupDelegate::SetSurfaceIdMap(
  18. const SurfaceId& surface_id) {
  19. surface_id_map_[surface_id.frame_sink_id()] = surface_id.local_surface_id();
  20. }
  21. } // namespace viz