Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Functions
cubicpaths.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkFont.h"
#include "include/core/SkMatrix.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/SkTypeface.h"
#include "include/core/SkTypes.h"
#include "include/effects/SkGradientShader.h"
#include "src/base/SkRandom.h"
#include "tools/ToolUtils.h"
#include "tools/fonts/FontToolUtils.h"

Go to the source code of this file.

Classes

class  ClippedCubicGM
 
class  ClippedCubic2GM
 
class  CubicPathGM
 
class  CubicClosePathGM
 
class  CubicPathShaderGM
 

Functions

 DEF_SIMPLE_GM (bug5099, canvas, 50, 50)
 
 DEF_SIMPLE_GM (bug6083, canvas, 100, 50)
 

Function Documentation

◆ DEF_SIMPLE_GM() [1/2]

DEF_SIMPLE_GM ( bug5099  ,
canvas  ,
50  ,
50   
)

Definition at line 488 of file cubicpaths.cpp.

488 {
489 SkPaint p;
490 p.setColor(SK_ColorRED);
491 p.setAntiAlias(true);
492 p.setStyle(SkPaint::kStroke_Style);
493 p.setStrokeWidth(10);
494
495 SkPath path;
496 path.moveTo(6, 27);
497 path.cubicTo(31.5f, 1.5f, 3.5f, 4.5f, 29, 29);
498 canvas->drawPath(path, p);
499}
constexpr SkColor SK_ColorRED
Definition SkColor.h:126
@ kStroke_Style
set to stroke geometry
Definition SkPaint.h:194
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_SIMPLE_GM() [2/2]

DEF_SIMPLE_GM ( bug6083  ,
canvas  ,
100  ,
50   
)

Definition at line 501 of file cubicpaths.cpp.

501 {
502 SkPaint p;
503 p.setColor(SK_ColorRED);
504 p.setAntiAlias(true);
505 p.setStyle(SkPaint::kStroke_Style);
506 p.setStrokeWidth(15);
507 canvas->translate(-500, -130);
508 SkPath path;
509 path.moveTo(500.988f, 155.200f);
510 path.lineTo(526.109f, 155.200f);
511 SkPoint p1 = { 526.109f, 155.200f };
512 SkPoint p2 = { 525.968f, 212.968f };
513 SkPoint p3 = { 526.109f, 241.840f };
514 path.cubicTo(p1, p2, p3);
515 canvas->drawPath(path, p);
516 canvas->translate(50, 0);
517 path.reset();
518 p2.set(525.968f, 213.172f);
519 path.moveTo(500.988f, 155.200f);
520 path.lineTo(526.109f, 155.200f);
521 path.cubicTo(p1, p2, p3);
522 canvas->drawPath(path, p);
523}
void set(float x, float y)