skottie_color_map.h 806 B

12345678910111213141516171819202122232425262728
  1. // Copyright 2021 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. #ifndef CC_PAINT_SKOTTIE_COLOR_MAP_H_
  5. #define CC_PAINT_SKOTTIE_COLOR_MAP_H_
  6. #include <utility>
  7. #include "base/containers/flat_map.h"
  8. #include "base/strings/string_piece.h"
  9. #include "cc/paint/paint_export.h"
  10. #include "cc/paint/skottie_resource_metadata.h"
  11. #include "third_party/skia/include/core/SkColor.h"
  12. namespace cc {
  13. using SkottieColorMap = base::flat_map<SkottieResourceIdHash, SkColor>;
  14. CC_PAINT_EXPORT inline SkottieColorMap::value_type SkottieMapColor(
  15. base::StringPiece name,
  16. SkColor color) {
  17. return std::make_pair(HashSkottieResourceId(name), color);
  18. }
  19. } // namespace cc
  20. #endif // CC_PAINT_SKOTTIE_COLOR_MAP_H_