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 ELECTRON_SHELL_COMMON_SKIA_UTIL_H_
  5. #define ELECTRON_SHELL_COMMON_SKIA_UTIL_H_
  6. namespace base {
  7. class FilePath;
  8. }
  9. namespace gfx {
  10. class ImageSkia;
  11. }
  12. namespace electron::util {
  13. bool PopulateImageSkiaRepsFromPath(gfx::ImageSkia* image,
  14. const base::FilePath& path);
  15. bool AddImageSkiaRepFromBuffer(gfx::ImageSkia* image,
  16. const unsigned char* data,
  17. size_t size,
  18. int width,
  19. int height,
  20. double scale_factor);
  21. bool AddImageSkiaRepFromJPEG(gfx::ImageSkia* image,
  22. const unsigned char* data,
  23. size_t size,
  24. double scale_factor);
  25. bool AddImageSkiaRepFromPNG(gfx::ImageSkia* image,
  26. const unsigned char* data,
  27. size_t size,
  28. double scale_factor);
  29. #if BUILDFLAG(IS_WIN)
  30. bool ReadImageSkiaFromICO(gfx::ImageSkia* image, HICON icon);
  31. #endif
  32. } // namespace electron::util
  33. #endif // ELECTRON_SHELL_COMMON_SKIA_UTIL_H_