Flutter Engine
The Flutter Engine
Classes | Functions
pictureimagefilter.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkFont.h"
#include "include/core/SkImage.h"
#include "include/core/SkImageFilter.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPicture.h"
#include "include/core/SkPictureRecorder.h"
#include "include/core/SkRect.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkScalar.h"
#include "include/core/SkSize.h"
#include "include/core/SkString.h"
#include "include/core/SkTypeface.h"
#include "include/effects/SkImageFilters.h"
#include "tools/ToolUtils.h"
#include "tools/fonts/FontToolUtils.h"

Go to the source code of this file.

Classes

class  PictureImageFilterGM
 

Functions

static void fill_rect_filtered (SkCanvas *canvas, const SkRect &clipRect, sk_sp< SkImageFilter > filter)
 
static sk_sp< SkPicturemake_picture ()
 
static sk_sp< SkPicturemake_LCD_picture ()
 

Function Documentation

◆ fill_rect_filtered()

static void fill_rect_filtered ( SkCanvas canvas,
const SkRect clipRect,
sk_sp< SkImageFilter filter 
)
static

Definition at line 30 of file pictureimagefilter.cpp.

32 {
34 paint.setImageFilter(filter);
35 canvas->save();
36 canvas->clipRect(clipRect);
37 canvas->drawPaint(paint);
38 canvas->restore();
39}
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
Definition: SkCanvas.cpp:1361
void restore()
Definition: SkCanvas.cpp:461
void drawPaint(const SkPaint &paint)
Definition: SkCanvas.cpp:1668
int save()
Definition: SkCanvas.cpp:447
const Paint & paint
Definition: color_source.cc:38
clipRect(r.rect, r.opAA.op(), r.opAA.aa())) template<> void Draw

◆ make_LCD_picture()

static sk_sp< SkPicture > make_LCD_picture ( )
static

Definition at line 52 of file pictureimagefilter.cpp.

52 {
53 SkPictureRecorder recorder;
54 SkCanvas* canvas = recorder.beginRecording(100, 100);
57 paint.setColor(0xFFFFFFFF);
58 // this has to be small enough that it doesn't become a path
61 canvas->drawString("e", 20.0f, 70.0f, font, paint);
62 return recorder.finishRecordingAsPicture();
63}
constexpr SkColor SK_ColorTRANSPARENT
Definition: SkColor.h:99
void clear(SkColor color)
Definition: SkCanvas.h:1199
void drawString(const char str[], SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint)
Definition: SkCanvas.h:1803
Definition: SkFont.h:35
@ kSubpixelAntiAlias
glyph positioned in pixel using transparency
SkCanvas * beginRecording(const SkRect &bounds, sk_sp< SkBBoxHierarchy > bbh)
sk_sp< SkPicture > finishRecordingAsPicture()
sk_sp< SkTypeface > DefaultPortableTypeface()
font
Font Metadata and Metrics.

◆ make_picture()

static sk_sp< SkPicture > make_picture ( )
static

Definition at line 41 of file pictureimagefilter.cpp.

41 {
42 SkPictureRecorder recorder;
43 SkCanvas* canvas = recorder.beginRecording(100, 100);
45 paint.setColor(0xFFFFFFFF);
47 canvas->drawString("e", 20.0f, 70.0f, font, paint);
48 return recorder.finishRecordingAsPicture();
49}