LibreOffice Module vcl (master) 1
Enumerations | Functions | Variables
SkiaHelper Namespace Reference

Enumerations

enum  DirectImage {
  Yes ,
  No
}
 

Functions

VCL_PLUGIN_PUBLIC CGImageRef createCGImage (const Image &rImage)
 
GrDirectContext * getSharedGrDirectContext ()
 
void disableRenderMethod (RenderMethod method)
 
VCL_DLLPUBLIC sk_sp< SkSurface > createSkSurface (int width, int height, SkColorType type=kN32_SkColorType, SkAlphaType alpha=kPremul_SkAlphaType)
 
sk_sp< SkSurface > createSkSurface (const Size &size, SkColorType type=kN32_SkColorType, SkAlphaType alpha=kPremul_SkAlphaType)
 
sk_sp< SkSurface > createSkSurface (int width, int height, SkAlphaType alpha)
 
sk_sp< SkSurface > createSkSurface (const Size &size, SkAlphaType alpha)
 
VCL_DLLPUBLIC sk_sp< SkImage > createSkImage (const SkBitmap &bitmap)
 
VCL_DLLPUBLIC sk_sp< SkImage > makeCheckedImageSnapshot (sk_sp< SkSurface > surface)
 
VCL_DLLPUBLIC sk_sp< SkImage > makeCheckedImageSnapshot (sk_sp< SkSurface > surface, const SkIRect &bounds)
 
Size imageSize (const sk_sp< SkImage > &image)
 
SkColor toSkColor (Color color)
 
SkColor toSkColorWithTransparency (Color aColor, double fTransparency)
 
SkColor toSkColorWithIntensity (Color color, int intensity)
 
Color fromSkColor (SkColor color)
 
void setBlenderInvert (SkPaint *paint)
 
void setBlenderXor (SkPaint *paint)
 
VCL_DLLPUBLIC void prepareSkia (std::unique_ptr< sk_app::WindowContext >(*createGpuWindowContext)(bool))
 
void addCachedImage (const OString &key, sk_sp< SkImage > image)
 
sk_sp< SkImage > findCachedImage (const OString &key)
 
void removeCachedImage (sk_sp< SkImage > image)
 
tools::Long maxImageCacheSize ()
 
uint32_t getSkImageChecksum (sk_sp< SkImage > image)
 
VCL_DLLPUBLIC const SkSurfaceProps * surfaceProps ()
 
VCL_DLLPUBLIC void setPixelGeometry (SkPixelGeometry pixelGeometry)
 
bool isUnitTestRunning (const char *name=nullptr)
 
BmpScaleFlag goodScalingQuality (bool isGPU)
 
SkSamplingOptions makeSamplingOptions (BmpScaleFlag scalingType, SkMatrix matrix, int scalingFactor)
 
SkSamplingOptions makeSamplingOptions (BmpScaleFlag scalingType, const Size &srcSize, Size destSize, int scalingFactor)
 
SkSamplingOptions makeSamplingOptions (const SalTwoRect &rPosAry, int scalingFactor, int srcScalingFactor, bool isGPU)
 
SkRect scaleRect (const SkRect &rect, int scaling)
 
SkIRect scaleRect (const SkIRect &rect, int scaling)
 
void prefillSurface (const sk_sp< SkSurface > &surface)
 
VCL_DLLPUBLIC void dump (const SkBitmap &bitmap, const char *file)
 
VCL_DLLPUBLIC void dump (const sk_sp< SkImage > &image, const char *file)
 
VCL_DLLPUBLIC void dump (const sk_sp< SkSurface > &surface, const char *file)
 
DriverBlocklist::DeviceVendor getVendor ()
 
VCL_DLLPUBLIC bool isVCLSkiaEnabled ()
 
VCL_DLLPUBLIC OUString readLog ()
 
VCL_DLLPUBLIC bool isAlphaMaskBlendingEnabled ()
 

Variables

constexpr int downscaleRatioThreshold = 4
 
VCL_DLLPUBLIC uint32_t vendorId
 

Enumeration Type Documentation

◆ DirectImage

Enumerator
Yes 
No 

Definition at line 110 of file utils.hxx.

Function Documentation

◆ addCachedImage()

void SkiaHelper::addCachedImage ( const OString &  key,
sk_sp< SkImage >  image 
)

◆ createCGImage()

VCL_PLUGIN_PUBLIC CGImageRef SkiaHelper::createCGImage ( const Image rImage)

◆ createSkImage()

VCL_DLLPUBLIC sk_sp< SkImage > SkiaHelper::createSkImage ( const SkBitmap &  bitmap)

◆ createSkSurface() [1/4]

sk_sp< SkSurface > SkiaHelper::createSkSurface ( const Size size,
SkAlphaType  alpha 
)
inline

Definition at line 71 of file utils.hxx.

References alpha, createSkSurface(), and size.

◆ createSkSurface() [2/4]

sk_sp< SkSurface > SkiaHelper::createSkSurface ( const Size size,
SkColorType  type = kN32_SkColorType,
SkAlphaType  alpha = kPremul_SkAlphaType 
)
inline

Definition at line 60 of file utils.hxx.

References alpha, createSkSurface(), size, and type.

◆ createSkSurface() [3/4]

sk_sp< SkSurface > SkiaHelper::createSkSurface ( int  width,
int  height,
SkAlphaType  alpha 
)
inline

Definition at line 66 of file utils.hxx.

References alpha, and createSkSurface().

◆ createSkSurface() [4/4]

VCL_DLLPUBLIC sk_sp< SkSurface > SkiaHelper::createSkSurface ( int  width,
int  height,
SkColorType  type = kN32_SkColorType,
SkAlphaType  alpha = kPremul_SkAlphaType 
)

Referenced by createSkSurface().

◆ disableRenderMethod()

void SkiaHelper::disableRenderMethod ( RenderMethod  method)

◆ dump() [1/3]

VCL_DLLPUBLIC void SkiaHelper::dump ( const sk_sp< SkImage > &  image,
const char *  file 
)

◆ dump() [2/3]

VCL_DLLPUBLIC void SkiaHelper::dump ( const sk_sp< SkSurface > &  surface,
const char *  file 
)

◆ dump() [3/3]

VCL_DLLPUBLIC void SkiaHelper::dump ( const SkBitmap &  bitmap,
const char *  file 
)

◆ findCachedImage()

sk_sp< SkImage > SkiaHelper::findCachedImage ( const OString &  key)

◆ fromSkColor()

Color SkiaHelper::fromSkColor ( SkColor  color)
inline

Definition at line 102 of file utils.hxx.

References ColorAlpha.

◆ getSharedGrDirectContext()

GrDirectContext * SkiaHelper::getSharedGrDirectContext ( )

◆ getSkImageChecksum()

uint32_t SkiaHelper::getSkImageChecksum ( sk_sp< SkImage >  image)

◆ getVendor()

DriverBlocklist::DeviceVendor SkiaHelper::getVendor ( )
inline

Definition at line 263 of file utils.hxx.

References DriverBlocklist::GetVendorFromId(), and vendorId.

◆ goodScalingQuality()

BmpScaleFlag SkiaHelper::goodScalingQuality ( bool  isGPU)
inline

◆ imageSize()

Size SkiaHelper::imageSize ( const sk_sp< SkImage > &  image)
inline

Definition at line 84 of file utils.hxx.

◆ isAlphaMaskBlendingEnabled()

VCL_DLLPUBLIC bool SkiaHelper::isAlphaMaskBlendingEnabled ( )

◆ isUnitTestRunning()

bool SkiaHelper::isUnitTestRunning ( const char *  name = nullptr)
inline

Definition at line 141 of file utils.hxx.

References vcl::test::activeGraphicsRenderTest(), and name.

Referenced by makeSamplingOptions().

◆ isVCLSkiaEnabled()

VCL_DLLPUBLIC bool SkiaHelper::isVCLSkiaEnabled ( )

◆ makeCheckedImageSnapshot() [1/2]

VCL_DLLPUBLIC sk_sp< SkImage > SkiaHelper::makeCheckedImageSnapshot ( sk_sp< SkSurface >  surface)

◆ makeCheckedImageSnapshot() [2/2]

VCL_DLLPUBLIC sk_sp< SkImage > SkiaHelper::makeCheckedImageSnapshot ( sk_sp< SkSurface >  surface,
const SkIRect &  bounds 
)

◆ makeSamplingOptions() [1/3]

SkSamplingOptions SkiaHelper::makeSamplingOptions ( BmpScaleFlag  scalingType,
const Size srcSize,
Size  destSize,
int  scalingFactor 
)
inline

◆ makeSamplingOptions() [2/3]

SkSamplingOptions SkiaHelper::makeSamplingOptions ( BmpScaleFlag  scalingType,
SkMatrix  matrix,
int  scalingFactor 
)
inline

◆ makeSamplingOptions() [3/3]

SkSamplingOptions SkiaHelper::makeSamplingOptions ( const SalTwoRect rPosAry,
int  scalingFactor,
int  srcScalingFactor,
bool  isGPU 
)
inline

◆ maxImageCacheSize()

tools::Long SkiaHelper::maxImageCacheSize ( )

◆ prefillSurface()

void SkiaHelper::prefillSurface ( const sk_sp< SkSurface > &  surface)

◆ prepareSkia()

VCL_DLLPUBLIC void SkiaHelper::prepareSkia ( std::unique_ptr< sk_app::WindowContext >(*)(bool)  createGpuWindowContext)

◆ readLog()

VCL_DLLPUBLIC OUString SkiaHelper::readLog ( )

◆ removeCachedImage()

void SkiaHelper::removeCachedImage ( sk_sp< SkImage >  image)

◆ scaleRect() [1/2]

SkIRect SkiaHelper::scaleRect ( const SkIRect &  rect,
int  scaling 
)
inline

Definition at line 247 of file utils.hxx.

◆ scaleRect() [2/2]

SkRect SkiaHelper::scaleRect ( const SkRect &  rect,
int  scaling 
)
inline

Definition at line 241 of file utils.hxx.

◆ setBlenderInvert()

void SkiaHelper::setBlenderInvert ( SkPaint *  paint)

◆ setBlenderXor()

void SkiaHelper::setBlenderXor ( SkPaint *  paint)

◆ setPixelGeometry()

VCL_DLLPUBLIC void SkiaHelper::setPixelGeometry ( SkPixelGeometry  pixelGeometry)

◆ surfaceProps()

VCL_DLLPUBLIC const SkSurfaceProps * SkiaHelper::surfaceProps ( )

◆ toSkColor()

SkColor SkiaHelper::toSkColor ( Color  color)
inline

◆ toSkColorWithIntensity()

SkColor SkiaHelper::toSkColorWithIntensity ( Color  color,
int  intensity 
)
inline

Definition at line 96 of file utils.hxx.

◆ toSkColorWithTransparency()

SkColor SkiaHelper::toSkColorWithTransparency ( Color  aColor,
double  fTransparency 
)
inline

Definition at line 91 of file utils.hxx.

References toSkColor().

Referenced by SkiaSalGraphicsImpl::makeFillPaint(), and SkiaSalGraphicsImpl::makeLinePaint().

Variable Documentation

◆ downscaleRatioThreshold

constexpr int SkiaHelper::downscaleRatioThreshold = 4
constexpr

Definition at line 172 of file utils.hxx.

Referenced by makeSamplingOptions().

◆ vendorId

VCL_DLLPUBLIC uint32_t SkiaHelper::vendorId
extern