Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
gm
fadefilter.cpp
Go to the documentation of this file.
1
/*
2
* Copyright 2015 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
"
9
#include "
include/core/SkCanvas.h
"
10
#include "
include/core/SkColorFilter.h
"
11
#include "
include/core/SkImageFilter.h
"
12
#include "
include/core/SkPaint.h
"
13
#include "
include/core/SkRect.h
"
14
#include "
include/core/SkRefCnt.h
"
15
#include "
include/effects/SkImageFilters.h
"
16
17
#include <utility>
18
19
// This GM renders correctly in 8888, but fails in PDF
20
DEF_SIMPLE_GM
(fadefilter, canvas, 256, 256) {
21
float
matrix[20] = { 1, 0, 0, 0, 0.5f,
22
0, 1, 0, 0, 0.5f,
23
0, 0, 1, 0, 0.5f,
24
0, 0, 0, 1, 0 };
25
sk_sp<SkColorFilter>
colorFilter(
SkColorFilters::Matrix
(matrix));
26
SkPaint
layerPaint;
27
layerPaint.
setImageFilter
(
SkImageFilters::ColorFilter
(std::move(colorFilter),
nullptr
));
28
canvas->drawRect(
SkRect::MakeLTRB
(64, 64, 192, 192), layerPaint);
29
}
SkCanvas.h
SkColorFilter.h
SkImageFilter.h
SkImageFilters.h
SkPaint.h
SkRect.h
SkRefCnt.h
SkColorFilters::Matrix
static sk_sp< SkColorFilter > Matrix(const SkColorMatrix &)
Definition
SkMatrixColorFilter.cpp:103
SkImageFilters::ColorFilter
static sk_sp< SkImageFilter > ColorFilter(sk_sp< SkColorFilter > cf, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
Definition
SkColorFilterImageFilter.cpp:72
SkPaint
Definition
SkPaint.h:44
SkPaint::setImageFilter
void setImageFilter(sk_sp< SkImageFilter > imageFilter)
sk_sp
Definition
SkRefCnt.h:220
gm.h
DEF_SIMPLE_GM
#define DEF_SIMPLE_GM(NAME, CANVAS, W, H)
Definition
gm.h:50
SkRect::MakeLTRB
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)
Definition
SkRect.h:646
Generated on Fri Apr 26 2024 06:16:02 for Flutter Engine by
1.9.8