Flutter Engine
The Flutter Engine
Functions
crbug_1313579.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkRect.h"
#include "include/effects/SkImageFilters.h"

Go to the source code of this file.

Functions

 DEF_SIMPLE_GM (crbug_1313579, canvas, 110, 110)
 

Function Documentation

◆ DEF_SIMPLE_GM()

DEF_SIMPLE_GM ( crbug_1313579  ,
canvas  ,
110  ,
110   
)

Definition at line 20 of file crbug_1313579.cpp.

20 {
21 static constexpr auto kBGRect = SkIRect{0, 0, 100, 100};
22
23 sk_sp<SkImageFilter> backdrop_filter =
24 SkImageFilters::Blur(50.f, 50.f, SkTileMode::kClamp, nullptr, kBGRect);
25
26 SkMatrix m;
27
28 canvas->clear(SK_ColorGREEN);
29
30 m.setAll(0.999999f, 0, 4.99999f,
31 0, 0.999999f, 4.99999f,
32 0, 0, 1);
33 canvas->concat(m);
34 canvas->clipIRect(kBGRect);
35 canvas->clear(SK_ColorWHITE);
36 canvas->saveLayer(SkCanvas::SaveLayerRec(nullptr, nullptr, backdrop_filter.get(), 0));
37 canvas->restore();
38}
constexpr SkColor SK_ColorGREEN
Definition: SkColor.h:131
constexpr SkColor SK_ColorWHITE
Definition: SkColor.h:122
static sk_sp< SkImageFilter > Blur(SkScalar sigmaX, SkScalar sigmaY, SkTileMode tileMode, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
T * get() const
Definition: SkRefCnt.h:303
Definition: SkRect.h:32