Flutter Engine
The Flutter Engine
Classes | Functions
ShaderMaskFilterBench.cpp File Reference
#include "bench/Benchmark.h"
#include "include/core/SkBBHFactory.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkMaskFilter.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPictureRecorder.h"
#include "include/core/SkSurface.h"
#include "include/core/SkTileMode.h"
#include "include/effects/SkShaderMaskFilter.h"
#include "src/shaders/SkPictureShader.h"

Go to the source code of this file.

Classes

class  ShaderMFBench
 

Functions

static sk_sp< SkShadermake_bitmap_shader ()
 
static sk_sp< SkShadermake_picture_shader ()
 

Function Documentation

◆ make_bitmap_shader()

static sk_sp< SkShader > make_bitmap_shader ( )
static

Definition at line 19 of file ShaderMaskFilterBench.cpp.

19 {
20 SkPaint p;
21 p.setColor(SK_ColorBLACK);
22 p.setAntiAlias(true);
23
25 surface->getCanvas()->drawCircle(50, 50, 50, p);
26
27 return surface->makeImageSnapshot()->makeShader(SkTileMode::kRepeat, SkTileMode::kRepeat,
29}
constexpr SkColor SK_ColorBLACK
Definition: SkColor.h:103
VkSurfaceKHR surface
Definition: main.cc:49
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
SkSamplingOptions(SkFilterMode::kLinear))
static SkImageInfo MakeN32Premul(int width, int height)

◆ make_picture_shader()

static sk_sp< SkShader > make_picture_shader ( )
static

Definition at line 31 of file ShaderMaskFilterBench.cpp.

31 {
32 SkPaint p;
33 p.setColor(SK_ColorBLACK);
34 p.setAntiAlias(true);
35
36 SkPictureRecorder recorder;
37 recorder.beginRecording(100, 100)->drawCircle(50, 50, 50, p);
38
41}
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
Definition: SkCanvas.cpp:2707
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