Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
bug6643.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPicture.h"
#include "include/core/SkPictureRecorder.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkShader.h"
#include "include/core/SkTileMode.h"
#include "include/core/SkTypes.h"
#include "include/effects/SkGradientShader.h"

Go to the source code of this file.

Functions

 DEF_SIMPLE_GM (bug6643, canvas, 200, 200)
 

Function Documentation

◆ DEF_SIMPLE_GM()

DEF_SIMPLE_GM ( bug6643  ,
canvas  ,
200  ,
200   
)

Definition at line 20 of file bug6643.cpp.

20 {
22
23 SkPaint p;
24 p.setAntiAlias(true);
25 p.setShader(SkGradientShader::MakeSweep(100, 100, colors, nullptr, std::size(colors),
27 nullptr));
28
29 SkPictureRecorder recorder;
30 recorder.beginRecording(200, 200)->drawPaint(p);
31
32 p.setShader(recorder.finishRecordingAsPicture()->makeShader(
34 SkFilterMode::kNearest, nullptr, nullptr));
35 canvas->drawColor(SK_ColorWHITE);
36 canvas->drawPaint(p);
37}
uint32_t SkColor
Definition SkColor.h:37
constexpr SkColor SK_ColorTRANSPARENT
Definition SkColor.h:99
constexpr SkColor SK_ColorGREEN
Definition SkColor.h:131
constexpr SkColor SK_ColorWHITE
Definition SkColor.h:122
void drawPaint(const SkPaint &paint)
static sk_sp< SkShader > MakeSweep(SkScalar cx, SkScalar cy, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, SkScalar startAngle, SkScalar endAngle, uint32_t flags, const SkMatrix *localMatrix)
SkCanvas * beginRecording(const SkRect &bounds, sk_sp< SkBBoxHierarchy > bbh)
sk_sp< SkPicture > finishRecordingAsPicture()
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, SkFilterMode mode, const SkMatrix *localMatrix, const SkRect *tileRect) const
PODArray< SkColor > colors
Definition SkRecords.h:276