Flutter Engine
The Flutter Engine
Functions
imagefiltersunpremul.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkImage.h"
#include "include/core/SkPaint.h"
#include "include/effects/SkImageFilters.h"

Go to the source code of this file.

Functions

 DEF_SIMPLE_GM_BG (imagefiltersunpremul, canvas, 64, 64, SK_ColorBLACK)
 

Function Documentation

◆ DEF_SIMPLE_GM_BG()

DEF_SIMPLE_GM_BG ( imagefiltersunpremul  ,
canvas  ,
64  ,
64  ,
SK_ColorBLACK   
)

Definition at line 16 of file imagefiltersunpremul.cpp.

16 {
17 // Draw an kUnpremul_SkAlphaType image using SkImageFilters::Image() and
18 // verify alpha channel was blended correctly.
21 bitmap.eraseColor(SkColorSetARGB(50, 255, 0, 0));
25 canvas->drawPaint(paint);
26}
kUnpremul_SkAlphaType
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
Definition: SkColorType.h:24
static constexpr SkColor SkColorSetARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
Definition: SkColor.h:49
static sk_sp< SkImageFilter > Image(sk_sp< SkImage > image, const SkRect &srcRect, const SkRect &dstRect, const SkSamplingOptions &sampling)
const Paint & paint
Definition: color_source.cc:38
SK_API sk_sp< SkImage > RasterFromBitmap(const SkBitmap &bitmap)
Definition: bitmap.py:1
static constexpr SkCubicResampler Mitchell()
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)