Flutter Engine
The Flutter Engine
Classes | Namespaces | Functions | Variables
polygonoffset.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPath.h"
#include "include/core/SkPoint.h"
#include "include/core/SkRect.h"
#include "include/core/SkScalar.h"
#include "include/core/SkSize.h"
#include "include/core/SkString.h"
#include "include/core/SkTypes.h"
#include "include/private/base/SkTDArray.h"
#include "src/utils/SkPolyUtils.h"
#include "tools/ToolUtils.h"
#include <functional>
#include <memory>

Go to the source code of this file.

Classes

class  skiagm::PolygonOffsetGM
 

Namespaces

namespace  PolygonOffsetData
 
namespace  skiagm
 

Functions

static void create_ngon (int n, SkPoint *pts, SkScalar w, SkScalar h, SkPathDirection dir)
 

Variables

const SkPoint PolygonOffsetData::gPoints0 []
 
const SkPoint PolygonOffsetData::gPoints1 []
 
const SkPoint PolygonOffsetData::gPoints2 []
 
const SkPoint PolygonOffsetData::gPoints3 []
 
const SkPoint PolygonOffsetData::gPoints4 []
 
const SkPoint PolygonOffsetData::gPoints5 []
 
const SkPoint PolygonOffsetData::gPoints6 []
 
const SkPoint PolygonOffsetData::gPoints7 []
 
const SkPoint PolygonOffsetData::gPoints8 []
 
const SkPoint PolygonOffsetData::gPoints9 []
 
const SkPoint PolygonOffsetData::gPoints10 []
 
const SkPoint PolygonOffsetData::gPoints11 []
 
const SkPoint PolygonOffsetData::gPoints12 []
 
const SkScalar PolygonOffsetData::kBottom = 25.f
 
const SkPoint PolygonOffsetData::gPoints13 []
 
const SkPoint PolygonOffsetData::gPoints14 []
 
const SkPoint PolygonOffsetData::gPoints15 []
 
const SkPoint PolygonOffsetData::gPoints16 []
 
const SkPoint PolygonOffsetData::gPoints17 []
 
const SkPoint PolygonOffsetData::gPoints18 []
 
const SkPointPolygonOffsetData::gConvexPoints []
 
const size_t PolygonOffsetData::gConvexSizes []
 
const SkPointPolygonOffsetData::gSimplePoints []
 
const size_t PolygonOffsetData::gSimpleSizes []
 

Function Documentation

◆ create_ngon()

static void create_ngon ( int  n,
SkPoint pts,
SkScalar  w,
SkScalar  h,
SkPathDirection  dir 
)
static

Definition at line 27 of file polygonoffset.cpp.

27 {
28 float angleStep = 360.0f / n, angle = 0.0f;
29 if ((n % 2) == 1) {
30 angle = angleStep/2.0f;
31 }
33 angle = -angle;
34 angleStep = -angleStep;
35 }
36
37 for (int i = 0; i < n; ++i) {
38 pts[i].fX = -SkScalarSin(SkDegreesToRadians(angle)) * w;
39 pts[i].fY = SkScalarCos(SkDegreesToRadians(angle)) * h;
40 angle += angleStep;
41 }
42}
#define SkDegreesToRadians(degrees)
Definition: SkScalar.h:77
#define SkScalarSin(radians)
Definition: SkScalar.h:45
#define SkScalarCos(radians)
Definition: SkScalar.h:46
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets dir
Definition: switches.h:145
SkScalar w
SkScalar h
float fX
x-axis value
Definition: SkPoint_impl.h:164
float fY
y-axis value
Definition: SkPoint_impl.h:165