Flutter Engine
The Flutter Engine
Classes | Namespaces | Functions
ovals.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPath.h"
#include "include/core/SkPathTypes.h"
#include "include/core/SkPoint.h"
#include "include/core/SkRect.h"
#include "include/core/SkScalar.h"
#include "include/core/SkShader.h"
#include "include/core/SkSize.h"
#include "include/core/SkString.h"
#include "include/core/SkTileMode.h"
#include "include/core/SkTypes.h"
#include "include/effects/SkGradientShader.h"
#include "include/private/base/SkTArray.h"
#include "src/base/SkRandom.h"
#include "tools/ToolUtils.h"

Go to the source code of this file.

Classes

class  skiagm::OvalGM
 

Namespaces

namespace  skiagm
 

Functions

 DEF_SIMPLE_GM (open_ovals, canvas, 225, 110)
 

Function Documentation

◆ DEF_SIMPLE_GM()

DEF_SIMPLE_GM ( open_ovals  ,
canvas  ,
225  ,
110   
)

Definition at line 312 of file ovals.cpp.

312 {
314 paint.setAntiAlias(true);
316
317 const SkRect rect = SkRect::MakeWH(50, 100);
319 const int start = 1;
320
321 // We stroke several open ovals to see how they behave
322 canvas->translate(5, 5);
323
324 auto doRow = [&](const SkPath& p) {
325 canvas->drawPath(p, paint);
326 canvas->translate(55, 0);
327 };
328
329 // Default case (left open) looks like an oval
330 SkPath path;
331 path.addOpenOval(rect, dir, start);
332 doRow(path);
333
334 // Closing makes us technically be an oval, but should look the same
335 path.close();
336 doRow(path);
337
338 // Moving before the oval adds a line to the start
339 path.reset();
340 path.moveTo(rect.center());
341 path.addOpenOval(rect, dir, start);
342 doRow(path);
343
344 // Similarly, lineTo after the oval starts from the start/end point
345 path.reset();
346 path.addOpenOval(rect, dir, start);
347 path.lineTo(rect.center());
348 doRow(path);
349}
SkPathDirection
Definition: SkPathTypes.h:34
@ kStroke_Style
set to stroke geometry
Definition: SkPaint.h:194
Definition: SkPath.h:59
const Paint & paint
Definition: color_source.cc:38
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350
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
Definition: switches.h:57
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
static constexpr SkRect MakeWH(float w, float h)
Definition: SkRect.h:609