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

Go to the source code of this file.

Functions

 REG_FIDDLE (Canvas_getDeviceClipBounds, 256, 256, true, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Canvas_getDeviceClipBounds  ,
256  ,
256  ,
true  ,
 
)

Definition at line 4 of file Canvas_getDeviceClipBounds.cpp.

4 {
5void draw(SkCanvas* canvas) {
6 SkCanvas device(256, 256);
7 canvas = &device;
9 SkDebugf("left:%d top:%d right:%d bottom:%d\n",
10 bounds.fLeft, bounds.fTop, bounds.fRight, bounds.fBottom);
11 SkPoint clipPoints[] = {{30, 130}, {120, 130}, {120, 230} };
13 clipPath.addPoly(clipPoints, std::size(clipPoints), true);
14 canvas->save();
15 canvas->clipPath(clipPath);
16 bounds = canvas->getDeviceClipBounds();
17 SkDebugf("left:%d top:%d right:%d bottom:%d\n",
18 bounds.fLeft, bounds.fTop, bounds.fRight, bounds.fBottom);
19 canvas->restore();
20 canvas->scale(1.f/2, 1.f/2);
21 canvas->clipPath(clipPath);
22 bounds = canvas->getDeviceClipBounds();
23 SkDebugf("left:%d top:%d right:%d bottom:%d\n",
24 bounds.fLeft, bounds.fTop, bounds.fRight, bounds.fBottom);
25}
26} // 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
void restore()
Definition: SkCanvas.cpp:461
void clipPath(const SkPath &path, SkClipOp op, bool doAntiAlias)
Definition: SkCanvas.cpp:1456
SkIRect getDeviceClipBounds() const
Definition: SkCanvas.cpp:1607
int save()
Definition: SkCanvas.cpp:447
void scale(SkScalar sx, SkScalar sy)
Definition: SkCanvas.cpp:1289
Definition: SkPath.h:59
VkDevice device
Definition: main.cc:53
Optional< SkRect > bounds
Definition: SkRecords.h:189
clipPath(r.path, r.opAA.op(), r.opAA.aa())) DRAW(ClipRRect
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259
Definition: SkRect.h:32