2019-07-30 20:49:25 +00:00
|
|
|
// Copyright (c) 2019 GitHub, Inc.
|
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2021-11-22 07:34:31 +00:00
|
|
|
#ifndef ELECTRON_SHELL_COMMON_SKIA_UTIL_H_
|
|
|
|
#define ELECTRON_SHELL_COMMON_SKIA_UTIL_H_
|
2019-07-30 20:49:25 +00:00
|
|
|
|
2021-07-02 00:51:37 +00:00
|
|
|
namespace base {
|
|
|
|
class FilePath;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace gfx {
|
|
|
|
class ImageSkia;
|
|
|
|
}
|
2019-07-30 20:49:25 +00:00
|
|
|
|
|
|
|
namespace electron {
|
|
|
|
|
|
|
|
namespace util {
|
|
|
|
|
|
|
|
bool PopulateImageSkiaRepsFromPath(gfx::ImageSkia* image,
|
|
|
|
const base::FilePath& path);
|
|
|
|
|
|
|
|
bool AddImageSkiaRepFromBuffer(gfx::ImageSkia* image,
|
|
|
|
const unsigned char* data,
|
|
|
|
size_t size,
|
|
|
|
int width,
|
|
|
|
int height,
|
|
|
|
double scale_factor);
|
|
|
|
|
|
|
|
bool AddImageSkiaRepFromJPEG(gfx::ImageSkia* image,
|
|
|
|
const unsigned char* data,
|
|
|
|
size_t size,
|
|
|
|
double scale_factor);
|
|
|
|
|
|
|
|
bool AddImageSkiaRepFromPNG(gfx::ImageSkia* image,
|
|
|
|
const unsigned char* data,
|
|
|
|
size_t size,
|
|
|
|
double scale_factor);
|
|
|
|
|
2022-02-10 02:58:52 +00:00
|
|
|
#if BUILDFLAG(IS_WIN)
|
2019-07-30 20:49:25 +00:00
|
|
|
bool ReadImageSkiaFromICO(gfx::ImageSkia* image, HICON icon);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
} // namespace util
|
|
|
|
|
|
|
|
} // namespace electron
|
|
|
|
|
2021-11-22 07:34:31 +00:00
|
|
|
#endif // ELECTRON_SHELL_COMMON_SKIA_UTIL_H_
|