本文整理汇总了C++中SkFont::setSize方法的典型用法代码示例。如果您正苦于以下问题:C++ SkFont::setSize方法的具体用法?C++ SkFont::setSize怎么用?C++ SkFont::setSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkFont
的用法示例。
在下文中一共展示了SkFont::setSize方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onDraw
void onDraw(SkCanvas* canvas) override {
SkFont font;
font.setSize(30);
const char* text = fApplyKerning ? "Type AWAY" : "Hamburgefons";
const size_t textLen = strlen(text);
SkScalar x = SkIntToScalar(10);
SkScalar dy = font.getMetrics(nullptr);
SkScalar y = dy;
if (fApplyKerning) {
font.setSubpixel(true);
} else {
font.setLinearMetrics(true);
}
SkPaint paint;
for (int i = 0; i < gStylesCount; i++) {
font.setTypeface(fFaces[i]);
canvas->drawSimpleText(text, textLen, SkTextEncoding::kUTF8, x, y, font, paint);
if (fApplyKerning) {
drawKernText(canvas, text, textLen, x + 240, y, font, paint);
}
y += dy;
}
}
示例2: draw
void draw(SkCanvas* canvas) {
SkFont font;
font.setSize(24);
SkPaint canvasPaint;
canvasPaint.setColor(SK_ColorBLUE); // respected
canvasPaint.setTextSize(2); // ignored
sk_sp<SkTextBlob> blob = SkTextBlob::MakeFromString("Hello World", font);
canvas->drawTextBlob(blob, 20, 20, canvasPaint);
}
示例3: draw
void draw(SkCanvas* canvas) {
SkFont blobFont;
blobFont.setSize(24);
sk_sp<SkTextBlob> blob = SkTextBlob::MakeFromText("Hello World", 11, blobFont);
char storage[2048];
size_t used = blob->serialize(SkSerialProcs(), storage, sizeof(storage));
sk_sp<SkTextBlob> copy = SkTextBlob::Deserialize(storage, used, SkDeserialProcs());
canvas->drawTextBlob(copy, 20, 20, SkPaint());
std::string usage = "size=" + std::to_string(sizeof(storage)) + " used=" + std::to_string(used);
canvas->drawString(usage.c_str(), 20, 40, SkPaint());
}
示例4: draw
void draw(SkCanvas* canvas) {
SkTextBlobBuilder textBlobBuilder;
SkFont font;
font.setSize(50);
const SkTextBlobBuilder::RunBuffer& run =
textBlobBuilder.allocRun(font, 1, 20, 100);
run.glyphs[0] = 20;
sk_sp<const SkTextBlob> blob = textBlobBuilder.make();
SkPaint paint;
paint.setColor(SK_ColorBLUE);
canvas->drawTextBlob(blob.get(), 0, 0, paint);
}
示例5: add_run
static void add_run(SkTextBlobBuilder* builder, const char text[], SkScalar x, SkScalar y,
sk_sp<SkTypeface> tf) {
SkFont font;
font.setEdging(SkFont::Edging::kAntiAlias);
font.setSubpixel(true);
font.setSize(16);
font.setTypeface(tf);
int glyphCount = font.countText(text, strlen(text), SkTextEncoding::kUTF8);
SkTextBlobBuilder::RunBuffer buffer = builder->allocRun(font, glyphCount, x, y);
(void)font.textToGlyphs(text, strlen(text), SkTextEncoding::kUTF8, buffer.glyphs, glyphCount);
}
示例6: drawText
void drawText(SkCanvas* canvas) {
static const int kSizes[] = {8, 9, 10, 11, 12, 13, 18, 20, 25};
static const SkString kTexts[] = {SkString("ABCDEFGHIJKLMNOPQRSTUVWXYZ"),
SkString("abcdefghijklmnopqrstuvwxyz"),
SkString("0123456789"),
SkString("[email protected]#$%^&*()<>[]{}")};
SkFont font;
font.setEdging(SkFont::Edging::kAntiAlias);
font.setSubpixel(true);
static const SkScalar kSubPixelInc = 1 / 2.f;
SkScalar x = 0;
SkScalar y = 10;
SkScalar subpixelX = 0;
SkScalar subpixelY = 0;
bool offsetX = true;
if (GrContextOptions::Enable::kYes == fAllowMultipleTextures) {
canvas->scale(10, 10);
}
do {
for (auto s : kSizes) {
auto size = 2 * s;
font.setSize(size);
for (const auto& typeface : fTypefaces) {
font.setTypeface(typeface);
for (const auto& text : kTexts) {
x = size + draw_string(canvas, text, x + subpixelX, y + subpixelY, font);
x = SkScalarCeilToScalar(x);
if (x + 100 > kSize) {
x = 0;
y += SkScalarCeilToScalar(size + 3);
if (y > kSize) {
return;
}
}
}
}
(offsetX ? subpixelX : subpixelY) += kSubPixelInc;
offsetX = !offsetX;
}
} while (true);
}
示例7: TestPaintProps
// Verify that text-related properties are captured in run paints.
static void TestPaintProps(skiatest::Reporter* reporter) {
SkFont font;
// Kitchen sink font.
font.setSize(42);
font.setScaleX(4.2f);
font.setTypeface(ToolUtils::create_portable_typeface());
font.setSkewX(0.42f);
font.setHinting(SkFontHinting::kFull);
font.setEdging(SkFont::Edging::kSubpixelAntiAlias);
font.setEmbolden(true);
font.setLinearMetrics(true);
font.setSubpixel(true);
font.setEmbeddedBitmaps(true);
font.setForceAutoHinting(true);
// Ensure we didn't pick default values by mistake.
SkFont defaultFont;
REPORTER_ASSERT(reporter, defaultFont.getSize() != font.getSize());
REPORTER_ASSERT(reporter, defaultFont.getScaleX() != font.getScaleX());
REPORTER_ASSERT(reporter, defaultFont.getTypefaceOrDefault() != font.getTypefaceOrDefault());
REPORTER_ASSERT(reporter, defaultFont.getSkewX() != font.getSkewX());
REPORTER_ASSERT(reporter, defaultFont.getHinting() != font.getHinting());
REPORTER_ASSERT(reporter, defaultFont.getEdging() != font.getEdging());
REPORTER_ASSERT(reporter, defaultFont.isEmbolden() != font.isEmbolden());
REPORTER_ASSERT(reporter, defaultFont.isLinearMetrics() != font.isLinearMetrics());
REPORTER_ASSERT(reporter, defaultFont.isSubpixel() != font.isSubpixel());
REPORTER_ASSERT(reporter,
defaultFont.isEmbeddedBitmaps() != font.isEmbeddedBitmaps());
REPORTER_ASSERT(reporter, defaultFont.isForceAutoHinting() != font.isForceAutoHinting());
SkTextBlobBuilder builder;
AddRun(font, 1, SkTextBlobRunIterator::kDefault_Positioning, SkPoint::Make(0, 0), builder);
AddRun(font, 1, SkTextBlobRunIterator::kHorizontal_Positioning, SkPoint::Make(0, 0),
builder);
AddRun(font, 1, SkTextBlobRunIterator::kFull_Positioning, SkPoint::Make(0, 0), builder);
sk_sp<SkTextBlob> blob(builder.make());
SkTextBlobRunIterator it(blob.get());
while (!it.done()) {
REPORTER_ASSERT(reporter, it.font() == font);
it.next();
}
}
示例8: draw_scene
static void draw_scene(SkCanvas* canvas, const SkHighContrastConfig& config) {
SkRect bounds = SkRect::MakeLTRB(0.0f, 0.0f, 1.0f, 1.0f);
SkPaint xferPaint;
xferPaint.setColorFilter(SkHighContrastFilter::Make(config));
canvas->saveLayer(&bounds, &xferPaint);
SkPaint paint;
bounds = SkRect::MakeLTRB(0.1f, 0.2f, 0.9f, 0.4f);
paint.setARGB(0xff, 0x66, 0x11, 0x11);
canvas->drawRect(bounds, paint);
SkFont font;
font.setSize(0.15f);
font.setEdging(SkFont::Edging::kAlias);
paint.setARGB(0xff, 0xbb, 0x77, 0x77);
canvas->drawString("A", 0.15f, 0.35f, font, paint);
bounds = SkRect::MakeLTRB(0.1f, 0.8f, 0.9f, 1.0f);
paint.setARGB(0xff, 0xcc, 0xcc, 0xff);
canvas->drawRect(bounds, paint);
paint.setARGB(0xff, 0x88, 0x88, 0xbb);
canvas->drawString("Z", 0.75f, 0.95f, font, paint);
bounds = SkRect::MakeLTRB(0.1f, 0.4f, 0.9f, 0.6f);
SkPoint pts[] = { { 0, 0 }, { 1, 0 } };
SkColor colors[] = { SK_ColorWHITE, SK_ColorBLACK };
SkScalar pos[] = { 0.2f, 0.8f };
paint.setShader(SkGradientShader::MakeLinear(
pts, colors, pos,
SK_ARRAY_COUNT(colors), SkTileMode::kClamp));
canvas->drawRect(bounds, paint);
bounds = SkRect::MakeLTRB(0.1f, 0.6f, 0.9f, 0.8f);
SkColor colors2[] = { SK_ColorGREEN, SK_ColorWHITE };
paint.setShader(SkGradientShader::MakeLinear(
pts, colors2, pos,
SK_ARRAY_COUNT(colors2), SkTileMode::kClamp));
canvas->drawRect(bounds, paint);
canvas->restore();
}
示例9: make_big_bitmap
static void make_big_bitmap(SkBitmap* bm) {
static const char gText[] =
"We the people, in order to form a more perfect union, establish justice,"
" ensure domestic tranquility, provide for the common defense, promote the"
" general welfare and ensure the blessings of liberty to ourselves and our"
" posterity, do ordain and establish this constitution for the United"
" States of America.";
const int BIG_H = 120;
SkFont font;
font.setSize(SkIntToScalar(BIG_H));
const int BIG_W = SkScalarRoundToInt(font.measureText(gText, strlen(gText), SkTextEncoding::kUTF8));
bm->allocN32Pixels(BIG_W, BIG_H);
bm->eraseColor(SK_ColorWHITE);
SkCanvas canvas(*bm);
canvas.drawSimpleText(gText, strlen(gText), SkTextEncoding::kUTF8, 0, font.getSize()*4/5, font, SkPaint());
}
示例10: draw_label
static void draw_label(SkCanvas* canvas, const SkHighContrastConfig& config) {
char labelBuffer[256];
const char* invertStr =
(config.fInvertStyle == InvertStyle::kInvertBrightness ?
"InvBrightness" :
(config.fInvertStyle == InvertStyle::kInvertLightness ?
"InvLightness" : "NoInvert"));
snprintf(labelBuffer, sizeof(labelBuffer), "%s%s contrast=%.1f",
config.fGrayscale ? "Gray " : "",
invertStr,
config.fContrast);
SkFont font;
font.setTypeface(ToolUtils::create_portable_typeface());
font.setSize(0.05f);
font.setEdging(SkFont::Edging::kAlias);
size_t len = strlen(labelBuffer);
SkScalar width = font.measureText(labelBuffer, len, SkTextEncoding::kUTF8);
canvas->drawSimpleText(labelBuffer, len, SkTextEncoding::kUTF8, 0.5f - width / 2, 0.16f, font, SkPaint());
}
示例11: onDraw
virtual void onDraw(SkCanvas* inputCanvas) override {
SkScalar textSizes[] = { 9.0f, 9.0f*2.0f, 9.0f*5.0f, 9.0f*2.0f*5.0f };
SkScalar scales[] = { 2.0f*5.0f, 5.0f, 2.0f, 1.0f };
// set up offscreen rendering with distance field text
GrContext* ctx = inputCanvas->getGrContext();
SkISize size = onISize();
SkImageInfo info = SkImageInfo::MakeN32(size.width(), size.height(), kPremul_SkAlphaType,
inputCanvas->imageInfo().refColorSpace());
SkSurfaceProps props(SkSurfaceProps::kUseDeviceIndependentFonts_Flag,
SkSurfaceProps::kLegacyFontHost_InitType);
auto surface(SkSurface::MakeRenderTarget(ctx, SkBudgeted::kNo, info, 0, &props));
SkCanvas* canvas = surface ? surface->getCanvas() : inputCanvas;
// init our new canvas with the old canvas's matrix
canvas->setMatrix(inputCanvas->getTotalMatrix());
// apply global scale to test glyph positioning
canvas->scale(1.05f, 1.05f);
canvas->clear(0xffffffff);
SkPaint paint;
paint.setAntiAlias(true);
SkFont font(ToolUtils::create_portable_typeface("serif", SkFontStyle()));
font.setSubpixel(true);
const char* text = "Hamburgefons";
const size_t textLen = strlen(text);
// check scaling up
SkScalar x = SkIntToScalar(0);
SkScalar y = SkIntToScalar(78);
for (size_t i = 0; i < SK_ARRAY_COUNT(textSizes); ++i) {
SkAutoCanvasRestore acr(canvas, true);
canvas->translate(x, y);
canvas->scale(scales[i], scales[i]);
font.setSize(textSizes[i]);
canvas->drawSimpleText(text, textLen, SkTextEncoding::kUTF8, 0, 0, font, paint);
y += font.getMetrics(nullptr)*scales[i];
}
// check rotation
for (size_t i = 0; i < 5; ++i) {
SkScalar rotX = SkIntToScalar(10);
SkScalar rotY = y;
SkAutoCanvasRestore acr(canvas, true);
canvas->translate(SkIntToScalar(10 + i * 200), -80);
canvas->rotate(SkIntToScalar(i * 5), rotX, rotY);
for (int ps = 6; ps <= 32; ps += 3) {
font.setSize(SkIntToScalar(ps));
canvas->drawSimpleText(text, textLen, SkTextEncoding::kUTF8, rotX, rotY, font, paint);
rotY += font.getMetrics(nullptr);
}
}
// check scaling down
font.setEdging(SkFont::Edging::kSubpixelAntiAlias);
x = SkIntToScalar(680);
y = SkIntToScalar(20);
size_t arraySize = SK_ARRAY_COUNT(textSizes);
for (size_t i = 0; i < arraySize; ++i) {
SkAutoCanvasRestore acr(canvas, true);
canvas->translate(x, y);
SkScalar scaleFactor = SkScalarInvert(scales[arraySize - i - 1]);
canvas->scale(scaleFactor, scaleFactor);
font.setSize(textSizes[i]);
canvas->drawSimpleText(text, textLen, SkTextEncoding::kUTF8, 0, 0, font, paint);
y += font.getMetrics(nullptr)*scaleFactor;
}
// check pos text
{
SkAutoCanvasRestore acr(canvas, true);
canvas->scale(2.0f, 2.0f);
SkAutoTArray<SkGlyphID> glyphs(SkToInt(textLen));
int count = font.textToGlyphs(text, textLen, SkTextEncoding::kUTF8, glyphs.get(), textLen);
SkAutoTArray<SkPoint> pos(count);
font.setSize(textSizes[0]);
font.getPos(glyphs.get(), count, pos.get(), {340, 75});
auto blob = SkTextBlob::MakeFromPosText(glyphs.get(), count * sizeof(SkGlyphID),
pos.get(), font, SkTextEncoding::kGlyphID);
canvas->drawTextBlob(blob, 0, 0, paint);
}
// check gamma-corrected blending
const SkColor fg[] = {
0xFFFFFFFF,
0xFFFFFF00, 0xFFFF00FF, 0xFF00FFFF,
0xFFFF0000, 0xFF00FF00, 0xFF0000FF,
0xFF000000,
};
paint.setColor(0xFFF7F3F7);
SkRect r = SkRect::MakeLTRB(670, 215, 820, 397);
canvas->drawRect(r, paint);
//.........这里部分代码省略.........
示例12: makeBlob
sk_sp<SkTextBlob> makeBlob(unsigned blobIndex) {
SkTextBlobBuilder builder;
SkFont font;
font.setSubpixel(true);
font.setEdging(SkFont::Edging::kAntiAlias);
font.setTypeface(fTypeface);
for (unsigned l = 0; l < SK_ARRAY_COUNT(blobConfigs[blobIndex]); ++l) {
unsigned currentGlyph = 0;
for (unsigned c = 0; c < SK_ARRAY_COUNT(blobConfigs[blobIndex][l]); ++c) {
const BlobCfg* cfg = &blobConfigs[blobIndex][l][c];
unsigned count = cfg->count;
if (count > fGlyphs.count() - currentGlyph) {
count = fGlyphs.count() - currentGlyph;
}
if (0 == count) {
break;
}
font.setSize(kFontSize * cfg->scale);
const SkScalar advanceX = font.getSize() * 0.85f;
const SkScalar advanceY = font.getSize() * 1.5f;
SkPoint offset = SkPoint::Make(currentGlyph * advanceX + c * advanceX,
advanceY * l);
switch (cfg->pos) {
case kDefault_Pos: {
const SkTextBlobBuilder::RunBuffer& buf = builder.allocRun(font, count,
offset.x(),
offset.y());
memcpy(buf.glyphs, fGlyphs.begin() + currentGlyph, count * sizeof(uint16_t));
} break;
case kScalar_Pos: {
const SkTextBlobBuilder::RunBuffer& buf = builder.allocRunPosH(font, count,
offset.y());
SkTDArray<SkScalar> pos;
for (unsigned i = 0; i < count; ++i) {
*pos.append() = offset.x() + i * advanceX;
}
memcpy(buf.glyphs, fGlyphs.begin() + currentGlyph, count * sizeof(uint16_t));
memcpy(buf.pos, pos.begin(), count * sizeof(SkScalar));
} break;
case kPoint_Pos: {
const SkTextBlobBuilder::RunBuffer& buf = builder.allocRunPos(font, count);
SkTDArray<SkScalar> pos;
for (unsigned i = 0; i < count; ++i) {
*pos.append() = offset.x() + i * advanceX;
*pos.append() = offset.y() + i * (advanceY / count);
}
memcpy(buf.glyphs, fGlyphs.begin() + currentGlyph, count * sizeof(uint16_t));
memcpy(buf.pos, pos.begin(), count * sizeof(SkScalar) * 2);
} break;
default:
SK_ABORT("unhandled pos value");
}
currentGlyph += count;
}
}
return builder.make();
}
示例13: TestBounds
// This unit test verifies blob bounds computation.
static void TestBounds(skiatest::Reporter* reporter) {
SkTextBlobBuilder builder;
SkFont font;
// Explicit bounds.
{
sk_sp<SkTextBlob> blob(builder.make());
REPORTER_ASSERT(reporter, !blob);
}
{
SkRect r1 = SkRect::MakeXYWH(10, 10, 20, 20);
builder.allocRun(font, 16, 0, 0, &r1);
sk_sp<SkTextBlob> blob(builder.make());
REPORTER_ASSERT(reporter, blob->bounds() == r1);
}
{
SkRect r1 = SkRect::MakeXYWH(10, 10, 20, 20);
builder.allocRunPosH(font, 16, 0, &r1);
sk_sp<SkTextBlob> blob(builder.make());
REPORTER_ASSERT(reporter, blob->bounds() == r1);
}
{
SkRect r1 = SkRect::MakeXYWH(10, 10, 20, 20);
builder.allocRunPos(font, 16, &r1);
sk_sp<SkTextBlob> blob(builder.make());
REPORTER_ASSERT(reporter, blob->bounds() == r1);
}
{
SkRect r1 = SkRect::MakeXYWH(10, 10, 20, 20);
SkRect r2 = SkRect::MakeXYWH(15, 20, 50, 50);
SkRect r3 = SkRect::MakeXYWH(0, 5, 10, 5);
builder.allocRun(font, 16, 0, 0, &r1);
builder.allocRunPosH(font, 16, 0, &r2);
builder.allocRunPos(font, 16, &r3);
sk_sp<SkTextBlob> blob(builder.make());
REPORTER_ASSERT(reporter, blob->bounds() == SkRect::MakeXYWH(0, 5, 65, 65));
}
{
sk_sp<SkTextBlob> blob(builder.make());
REPORTER_ASSERT(reporter, !blob);
}
// Implicit bounds
{
// Exercise the empty bounds path, and ensure that RunRecord-aligned pos buffers
// don't trigger asserts (http://crbug.com/542643).
SkFont font;
font.setSize(0);
const char* txt = "BOOO";
const size_t txtLen = strlen(txt);
const int glyphCount = font.countText(txt, txtLen, SkTextEncoding::kUTF8);
const SkTextBlobBuilder::RunBuffer& buffer = builder.allocRunPos(font, glyphCount);
font.textToGlyphs(txt, txtLen, SkTextEncoding::kUTF8, buffer.glyphs, glyphCount);
memset(buffer.pos, 0, sizeof(SkScalar) * glyphCount * 2);
sk_sp<SkTextBlob> blob(builder.make());
REPORTER_ASSERT(reporter, blob->bounds().isEmpty());
}
}
示例14: onDrawContent
virtual void onDrawContent(SkCanvas* canvas) {
SkPath path;
path.moveTo(SkIntToScalar(0), SkIntToScalar(50));
path.quadTo(SkIntToScalar(0), SkIntToScalar(0), SkIntToScalar(50), SkIntToScalar(0));
path.lineTo(SkIntToScalar(175), SkIntToScalar(0));
path.quadTo(SkIntToScalar(200), SkIntToScalar(0), SkIntToScalar(200), SkIntToScalar(25));
path.lineTo(SkIntToScalar(200), SkIntToScalar(150));
path.quadTo(SkIntToScalar(200), SkIntToScalar(200), SkIntToScalar(150), SkIntToScalar(200));
path.lineTo(SkIntToScalar(0), SkIntToScalar(200));
path.close();
path.moveTo(SkIntToScalar(50), SkIntToScalar(50));
path.lineTo(SkIntToScalar(150), SkIntToScalar(50));
path.lineTo(SkIntToScalar(150), SkIntToScalar(125));
path.quadTo(SkIntToScalar(150), SkIntToScalar(150), SkIntToScalar(125), SkIntToScalar(150));
path.lineTo(SkIntToScalar(50), SkIntToScalar(150));
path.close();
path.setFillType(SkPath::kEvenOdd_FillType);
SkColor pathColor = SK_ColorBLACK;
SkPaint pathPaint;
pathPaint.setAntiAlias(true);
pathPaint.setColor(pathColor);
SkPath clipA;
clipA.moveTo(SkIntToScalar(10), SkIntToScalar(20));
clipA.lineTo(SkIntToScalar(165), SkIntToScalar(22));
clipA.lineTo(SkIntToScalar(70), SkIntToScalar(105));
clipA.lineTo(SkIntToScalar(165), SkIntToScalar(177));
clipA.lineTo(SkIntToScalar(-5), SkIntToScalar(180));
clipA.close();
SkColor colorA = SK_ColorCYAN;
SkPath clipB;
clipB.moveTo(SkIntToScalar(40), SkIntToScalar(10));
clipB.lineTo(SkIntToScalar(190), SkIntToScalar(15));
clipB.lineTo(SkIntToScalar(195), SkIntToScalar(190));
clipB.lineTo(SkIntToScalar(40), SkIntToScalar(185));
clipB.lineTo(SkIntToScalar(155), SkIntToScalar(100));
clipB.close();
SkColor colorB = SK_ColorRED;
SkFont font;
font.setSize(20);
SkPaint paint;
paint.setAntiAlias(true);
paint.setStyle(SkPaint::kStroke_Style);
paint.setStrokeWidth(0);
canvas->translate(SkIntToScalar(10),SkIntToScalar(10));
canvas->drawPath(path, pathPaint);
paint.setColor(colorA);
canvas->drawPath(clipA, paint);
paint.setColor(colorB);
canvas->drawPath(clipB, paint);
static const struct {
SkClipOp fOp;
const char* fName;
} gOps[] = { //extra spaces in names for measureText
{kIntersect_SkClipOp, "Isect "},
{kDifference_SkClipOp, "Diff " },
{kUnion_SkClipOp, "Union "},
{kXOR_SkClipOp, "Xor " },
{kReverseDifference_SkClipOp, "RDiff "}
};
canvas->translate(0, SkIntToScalar(40));
canvas->scale(3 * SK_Scalar1 / 4, 3 * SK_Scalar1 / 4);
canvas->save();
for (int invA = 0; invA < 2; ++invA) {
for (size_t op = 0; op < SK_ARRAY_COUNT(gOps); ++op) {
size_t idx = invA * SK_ARRAY_COUNT(gOps) + op;
if (!(idx % 3)) {
canvas->restore();
canvas->translate(0, SkIntToScalar(250));
canvas->save();
}
canvas->save();
// set clip
clipA.setFillType(invA ? SkPath::kInverseEvenOdd_FillType :
SkPath::kEvenOdd_FillType);
canvas->clipPath(clipA);
canvas->clipPath(clipB, gOps[op].fOp);
// draw path clipped
canvas->drawPath(path, pathPaint);
canvas->restore();
// draw path in hairline
paint.setColor(pathColor);
canvas->drawPath(path, paint);
// draw clips in hair line
paint.setColor(colorA);
canvas->drawPath(clipA, paint);
paint.setColor(colorB);
canvas->drawPath(clipB, paint);
//.........这里部分代码省略.........