Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
getLocalBounds_working.cpp File Reference
#include "tools/fiddle/examples.h"

Go to the source code of this file.

Functions

 REG_FIDDLE (getLocalBounds_working, 256, 256, true, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( getLocalBounds_working  ,
256  ,
256  ,
true  ,
 
)

Definition at line 4 of file getLocalBounds_working.cpp.

4 {
5void draw(SkCanvas* canvas) {
6 SkCanvas local(256, 256);
7 canvas = &local;
9 SkDebugf("left:%g top:%g right:%g bottom:%g\n", bounds.fLeft, bounds.fTop, bounds.fRight,
10 bounds.fBottom);
11 SkPoint clipPoints[] = {{30, 130}, {120, 130}, {120, 230}};
13 clipPath.addPoly(clipPoints, std::size(clipPoints), true);
14 canvas->clipPath(clipPath);
15 bounds = canvas->getLocalClipBounds();
16 SkDebugf("left:%g top:%g right:%g bottom:%g\n", bounds.fLeft, bounds.fTop, bounds.fRight,
17 bounds.fBottom);
18}
19} // END FIDDLE
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition aaclip.cpp:27
SkRect getLocalClipBounds() const
void clipPath(const SkPath &path, SkClipOp op, bool doAntiAlias)
Optional< SkRect > bounds
Definition SkRecords.h:189
clipPath(r.path, r.opAA.op(), r.opAA.aa())) DRAW(ClipRRect