skia_util.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. #include <string>
  7. #include "ui/gfx/image/image_skia.h"
  8. namespace electron {
  9. namespace util {
  10. bool PopulateImageSkiaRepsFromPath(gfx::ImageSkia* image,
  11. const base::FilePath& path);
  12. bool AddImageSkiaRepFromBuffer(gfx::ImageSkia* image,
  13. const unsigned char* data,
  14. size_t size,
  15. int width,
  16. int height,
  17. double scale_factor);
  18. bool AddImageSkiaRepFromJPEG(gfx::ImageSkia* image,
  19. const unsigned char* data,
  20. size_t size,
  21. double scale_factor);
  22. bool AddImageSkiaRepFromPNG(gfx::ImageSkia* image,
  23. const unsigned char* data,
  24. size_t size,
  25. double scale_factor);
  26. #if defined(OS_WIN)
  27. bool ReadImageSkiaFromICO(gfx::ImageSkia* image, HICON icon);
  28. #endif
  29. } // namespace util
  30. } // namespace electron
  31. #endif // SHELL_COMMON_SKIA_UTIL_H_