Flutter Engine
The Flutter Engine
third_party
skia
gm
blend.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/SkColor.h
"
11
#include "
include/core/SkPaint.h
"
12
#include "
include/core/SkRect.h
"
13
#include "
tools/ToolUtils.h
"
14
15
DEF_SIMPLE_GM
(
blend
, canvas, 300, 100) {
16
SkPaint
p
;
17
18
// All three of these blocks should be the same color.
19
canvas->save();
20
canvas->scale(100,100);
21
22
p
.setColor(
SK_ColorRED
);
23
canvas->drawRect(
SkRect::MakeXYWH
(0,0,1,1),
p
);
24
p
.setColor(0xFC208000);
25
canvas->drawRect(
SkRect::MakeXYWH
(0,0,1,1),
p
);
26
27
p
.setColor(
SK_ColorRED
);
28
canvas->drawRect(
SkRect::MakeXYWH
(1,0,1,1),
p
);
29
canvas->saveLayer(
nullptr
,
nullptr
);
30
p
.setColor(0xFC208000);
31
canvas->drawRect(
SkRect::MakeXYWH
(1,0,1,1),
p
);
32
canvas->restore();
33
34
p
.setColor(
SK_ColorRED
);
35
canvas->drawRect(
SkRect::MakeXYWH
(2,0,1,1),
p
);
36
canvas->saveLayerAlpha(
nullptr
, 0xFC);
37
p
.setColor(
ToolUtils::color_to_565
(0xFF208000));
38
canvas->drawRect(
SkRect::MakeXYWH
(2, 0, 1, 1),
p
);
39
canvas->restore();
40
canvas->restore();
41
}
SkCanvas.h
SkColor.h
SK_ColorRED
constexpr SkColor SK_ColorRED
Definition:
SkColor.h:126
SkPaint.h
SkRect.h
ToolUtils.h
DEF_SIMPLE_GM
DEF_SIMPLE_GM(blend, canvas, 300, 100)
Definition:
blend.cpp:15
SkPaint
Definition:
SkPaint.h:44
gm.h
blend
static SkColor blend(SkColor dst, SkColor src, void(*mode)(float, float, float, float *, float *, float *))
Definition:
hsl.cpp:142
ToolUtils::color_to_565
SkColor color_to_565(SkColor color)
Definition:
ToolUtils.cpp:139
dart_profiler_symbols.p
p
Definition:
dart_profiler_symbols.py:55
SkRect::MakeXYWH
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
Definition:
SkRect.h:659
Generated on Sun Jun 23 2024 21:55:58 for Flutter Engine by
1.9.4