CodecBenchPriv.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright 2015 Google Inc.
  3. *
  4. * Use of this source code is governed by a BSD-style license that can be
  5. * found in the LICENSE file.
  6. */
  7. #ifndef CodecBenchPriv_DEFINED
  8. #define CodecBenchPriv_DEFINED
  9. #include "include/core/SkImageInfo.h"
  10. inline const char* color_type_to_str(SkColorType colorType) {
  11. switch (colorType) {
  12. case kN32_SkColorType:
  13. return "N32";
  14. case kRGB_565_SkColorType:
  15. return "565";
  16. case kGray_8_SkColorType:
  17. return "Gray8";
  18. case kAlpha_8_SkColorType:
  19. return "Alpha8";
  20. default:
  21. return "Unknown";
  22. }
  23. }
  24. inline const char* alpha_type_to_str(SkAlphaType alphaType) {
  25. switch (alphaType) {
  26. case kOpaque_SkAlphaType:
  27. return "";
  28. case kPremul_SkAlphaType:
  29. return "Premul";
  30. case kUnpremul_SkAlphaType:
  31. return "Unpremul";
  32. default:
  33. SkASSERT(false);
  34. return "Unknown";
  35. }
  36. }
  37. #endif // CodecBenchPriv_DEFINED