skia_util.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Copyright (c) 2019 GitHub, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #ifndef SHELL_COMMON_SKIA_UTIL_H_
  5. #define SHELL_COMMON_SKIA_UTIL_H_
  6. namespace base {
  7. class FilePath;
  8. }
  9. namespace gfx {
  10. class ImageSkia;
  11. }
  12. namespace electron {
  13. namespace util {
  14. bool PopulateImageSkiaRepsFromPath(gfx::ImageSkia* image,
  15. const base::FilePath& path);
  16. bool AddImageSkiaRepFromBuffer(gfx::ImageSkia* image,
  17. const unsigned char* data,
  18. size_t size,
  19. int width,
  20. int height,
  21. double scale_factor);
  22. bool AddImageSkiaRepFromJPEG(gfx::ImageSkia* image,
  23. const unsigned char* data,
  24. size_t size,
  25. double scale_factor);
  26. bool AddImageSkiaRepFromPNG(gfx::ImageSkia* image,
  27. const unsigned char* data,
  28. size_t size,
  29. double scale_factor);
  30. #if defined(OS_WIN)
  31. bool ReadImageSkiaFromICO(gfx::ImageSkia* image, HICON icon);
  32. #endif
  33. } // namespace util
  34. } // namespace electron
  35. #endif // SHELL_COMMON_SKIA_UTIL_H_