Flutter Engine
The Flutter Engine
Functions
Picture_cullRect.cpp File Reference
#include "tools/fiddle/examples.h"

Go to the source code of this file.

Functions

 REG_FIDDLE (Picture_cullRect, 256, 256, false, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Picture_cullRect  ,
256  ,
256  ,
false  ,
 
)

Definition at line 4 of file Picture_cullRect.cpp.

4 {
5void draw(SkCanvas* canvas) {
6 SkPictureRecorder recorder;
7 SkCanvas* pictureCanvas = recorder.beginRecording({64, 64, 192, 192});
9 pictureCanvas->drawRect(SkRect::MakeWH(200, 200), paint);
10 paint.setColor(SK_ColorWHITE);
11 pictureCanvas->drawRect(SkRect::MakeLTRB(20, 20, 180, 180), paint);
13 picture->playback(canvas);
14 paint.setBlendMode(SkBlendMode::kModulate);
15 paint.setColor(0x40404040);
16 canvas->drawRect(picture->cullRect(), paint);
17}
18} // END FIDDLE
@ kModulate
r = s*d
constexpr SkColor SK_ColorWHITE
Definition: SkColor.h:122
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
void drawRect(const SkRect &rect, const SkPaint &paint)
Definition: SkCanvas.cpp:1673
SkCanvas * beginRecording(const SkRect &bounds, sk_sp< SkBBoxHierarchy > bbh)
sk_sp< SkPicture > finishRecordingAsPicture()
virtual SkRect cullRect() const =0
virtual void playback(SkCanvas *canvas, AbortCallback *callback=nullptr) const =0
const Paint & paint
Definition: color_source.cc:38
sk_sp< const SkPicture > picture
Definition: SkRecords.h:299
static constexpr SkRect MakeWH(float w, float h)
Definition: SkRect.h:609
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)
Definition: SkRect.h:646