Flutter Engine
The Flutter Engine
imagefiltersunpremul.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2023 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#include "gm/gm.h"
15
16DEF_SIMPLE_GM_BG(imagefiltersunpremul, canvas, 64, 64, SK_ColorBLACK) {
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
constexpr SkColor SK_ColorBLACK
Definition: SkColor.h:103
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
DEF_SIMPLE_GM_BG(imagefiltersunpremul, canvas, 64, 64, SK_ColorBLACK)
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)