Flutter Engine
The Flutter Engine
third_party
skia
docs
examples
Canvas_getContext.cpp
Go to the documentation of this file.
1
// Copyright 2019 Google LLC.
2
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
3
#include "
tools/fiddle/examples.h
"
4
REG_FIDDLE
(Canvas_getContext, 256, 256,
false
, 0) {
5
void
draw
(
SkCanvas
* canvas) {
6
if
(
auto
context = canvas->
recordingContext
()) {
7
if
(context->asDirectContext()) {
8
canvas->
clear
(
SK_ColorRED
);
9
}
else
{
10
canvas->
clear
(
SK_ColorGREEN
);
11
}
12
}
else
{
13
canvas->
clear
(
SK_ColorBLUE
);
14
}
15
}
16
}
// END FIDDLE
REG_FIDDLE
REG_FIDDLE(Canvas_getContext, 256, 256, false, 0)
Definition:
Canvas_getContext.cpp:4
SK_ColorBLUE
constexpr SkColor SK_ColorBLUE
Definition:
SkColor.h:135
SK_ColorRED
constexpr SkColor SK_ColorRED
Definition:
SkColor.h:126
SK_ColorGREEN
constexpr SkColor SK_ColorGREEN
Definition:
SkColor.h:131
draw
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition:
aaclip.cpp:27
SkCanvas
Definition:
SkCanvas.h:106
SkCanvas::recordingContext
virtual GrRecordingContext * recordingContext() const
Definition:
SkCanvas.cpp:1637
SkCanvas::clear
void clear(SkColor color)
Definition:
SkCanvas.h:1199
examples.h
Generated on Sun Jun 23 2024 21:55:55 for Flutter Engine by
1.9.4