Flutter Engine
The Flutter Engine
Classes | Namespaces | Functions
pathopsinverse.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPath.h"
#include "include/core/SkRect.h"
#include "include/core/SkScalar.h"
#include "include/core/SkSize.h"
#include "include/core/SkString.h"
#include "include/pathops/SkPathOps.h"
#include "tools/ToolUtils.h"
#include "include/utils/SkParsePath.h"

Go to the source code of this file.

Classes

class  skiagm::PathOpsInverseGM
 

Namespaces

namespace  skiagm
 

Functions

 DEF_SIMPLE_GM (pathops_skbug_10155, canvas, 256, 256)
 

Function Documentation

◆ DEF_SIMPLE_GM()

DEF_SIMPLE_GM ( pathops_skbug_10155  ,
canvas  ,
256  ,
256   
)

Definition at line 120 of file pathopsinverse.cpp.

120 {
121 const char* svgStr[] = {
122 "M474.889 27.0952C474.889 27.1002 474.888 27.1018 474.889 27.1004L479.872 27.5019C479.883 27.3656 479.889 27.2299 479.889 27.0952L474.889 27.0952L474.889 27.0952Z",
123 "M474.94 26.9405C474.93 26.9482 474.917 26.9576 474.901 26.9683L477.689 31.1186C477.789 31.0512 477.888 30.9804 477.985 30.9059L474.94 26.9405L474.94 26.9405Z"
124 };
125
126 SkPath path[2], resultPath;
128
129 for (int i = 0; i < 2; i++)
130 {
133 }
134
135 builder.resolve(&resultPath);
136
137 auto r = path[0].getBounds();
138 canvas->translate(30, 30);
139 canvas->scale(200 / r.width(), 200 / r.width());
140 canvas->translate(-r.fLeft, -r.fTop);
141
143 paint.setColor(SK_ColorRED);
144 paint.setAntiAlias(true);
146 paint.setStrokeWidth(0);
147
148 canvas->drawPath(path[0], paint);
149 canvas->drawPath(path[1], paint);
150
151 // The blue draw should (nearly) overdraw all of the red (except where the two paths intersect)
152 paint.setColor(SK_ColorBLUE);
153 canvas->drawPath(resultPath, paint);
154}
constexpr SkColor SK_ColorBLUE
Definition: SkColor.h:135
constexpr SkColor SK_ColorRED
Definition: SkColor.h:126
@ kUnion_SkPathOp
union (inclusive-or) the two paths
Definition: SkPathOps.h:25
@ kStroke_Style
set to stroke geometry
Definition: SkPaint.h:194
static bool FromSVGString(const char str[], SkPath *)
Definition: SkPath.h:59
const Paint & paint
Definition: color_source.cc:38
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