Flutter Engine
The Flutter Engine
Classes | Namespaces | Macros | Functions
imagefiltersscaled.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkImage.h"
#include "include/core/SkImageFilter.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPoint.h"
#include "include/core/SkPoint3.h"
#include "include/core/SkRect.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkScalar.h"
#include "include/core/SkShader.h"
#include "include/core/SkSize.h"
#include "include/core/SkString.h"
#include "include/core/SkSurface.h"
#include "include/core/SkTileMode.h"
#include "include/core/SkTypes.h"
#include "include/effects/SkGradientShader.h"
#include "include/effects/SkImageFilters.h"
#include "include/effects/SkPerlinNoiseShader.h"
#include "tools/ToolUtils.h"
#include <utility>

Go to the source code of this file.

Classes

class  skiagm::ImageFiltersScaledGM
 

Namespaces

namespace  skiagm
 

Macros

#define RESIZE_FACTOR   SkIntToScalar(4)
 

Functions

static sk_sp< SkImagemake_gradient_circle (int width, int height)
 

Macro Definition Documentation

◆ RESIZE_FACTOR

#define RESIZE_FACTOR   SkIntToScalar(4)

Definition at line 34 of file imagefiltersscaled.cpp.

Function Documentation

◆ make_gradient_circle()

static sk_sp< SkImage > make_gradient_circle ( int  width,
int  height 
)
static

Definition at line 36 of file imagefiltersscaled.cpp.

36 {
39 SkScalar radius = std::min(x, y) * 4 / 5;
41 SkCanvas* canvas = surface->getCanvas();
42 canvas->clear(0x00000000);
43 SkColor colors[2];
47 paint.setShader(SkGradientShader::MakeRadial(SkPoint::Make(x, y), radius, colors, nullptr,
49 canvas->drawCircle(x, y, radius, paint);
50
51 return surface->makeImageSnapshot();
52}
uint32_t SkColor
Definition: SkColor.h:37
constexpr SkColor SK_ColorBLACK
Definition: SkColor.h:103
constexpr SkColor SK_ColorWHITE
Definition: SkColor.h:122
#define SkIntToScalar(x)
Definition: SkScalar.h:57
void clear(SkColor color)
Definition: SkCanvas.h:1199
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
Definition: SkCanvas.cpp:2707
static sk_sp< SkShader > MakeRadial(const SkPoint &center, SkScalar radius, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
const Paint & paint
Definition: color_source.cc:38
VkSurfaceKHR surface
Definition: main.cc:49
float SkScalar
Definition: extension.cpp:12
static float min(float r, float g, float b)
Definition: hsl.cpp:48
double y
double x
PODArray< SkColor > colors
Definition: SkRecords.h:276
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
int32_t height
int32_t width
static SkImageInfo MakeN32Premul(int width, int height)
static constexpr SkPoint Make(float x, float y)
Definition: SkPoint_impl.h:173