当前位置: 首页>>代码示例>>C++>>正文


C++ SkPaint::setAnnotation方法代码示例

本文整理汇总了C++中SkPaint::setAnnotation方法的典型用法代码示例。如果您正苦于以下问题:C++ SkPaint::setAnnotation方法的具体用法?C++ SkPaint::setAnnotation怎么用?C++ SkPaint::setAnnotation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SkPaint的用法示例。


在下文中一共展示了SkPaint::setAnnotation方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: annotation_rp

static void annotation_rp(SkCanvas*, SkReader32* reader, uint32_t op32,
                          SkGPipeState* state) {
    SkPaint* p = state->editPaint();

    const size_t size = DrawOp_unpackData(op32);
    if (size > 0) {
        SkReadBuffer buffer(reader->skip(size), size);
        p->setAnnotation(SkAnnotation::Create(buffer))->unref();
        SkASSERT(buffer.offset() == size);
    } else {
        p->setAnnotation(NULL);
    }
}
开发者ID:webbjiang,项目名称:skia,代码行数:13,代码来源:SkGPipeRead.cpp

示例2: annotate_paint

static void annotate_paint(SkPaint& paint, const char* key, SkData* value) {
    SkAutoTUnref<SkDataSet> dataset(SkNEW_ARGS(SkDataSet, (key, value)));
    SkAnnotation* ann = SkNEW_ARGS(SkAnnotation, (dataset,
                                                  SkAnnotation::kNoDraw_Flag));

    paint.setAnnotation(ann)->unref();
    SkASSERT(paint.isNoDrawAnnotation());
}
开发者ID:ConradIrwin,项目名称:gecko-dev,代码行数:8,代码来源:SkAnnotation.cpp

示例3: make_paint

static SkPaint make_paint() {
    SkPaint paint;
    paint.setHinting(make_paint_hinting());
    paint.setAntiAlias(make_bool());
    paint.setDither(make_bool());
    paint.setLinearText(make_bool());
    paint.setSubpixelText(make_bool());
    paint.setLCDRenderText(make_bool());
    paint.setEmbeddedBitmapText(make_bool());
    paint.setAutohinted(make_bool());
    paint.setVerticalText(make_bool());
    paint.setUnderlineText(make_bool());
    paint.setStrikeThruText(make_bool());
    paint.setFakeBoldText(make_bool());
    paint.setDevKernText(make_bool());
    paint.setFilterQuality(make_filter_quality());
    paint.setStyle(make_paint_style());
    paint.setColor(make_color());
    paint.setStrokeWidth(make_scalar());
    paint.setStrokeMiter(make_scalar());
    paint.setStrokeCap(make_paint_cap());
    paint.setStrokeJoin(make_paint_join());
    paint.setColorFilter(make_color_filter());
    paint.setXfermodeMode(make_xfermode());
    paint.setPathEffect(make_path_effect());
    paint.setMaskFilter(make_mask_filter());
    SkAutoTUnref<SkTypeface> typeface(
        SkTypeface::CreateFromName(make_font_name().c_str(), make_typeface_style()));
    paint.setTypeface(typeface);
    SkLayerRasterizer::Builder rasterizerBuilder;
    SkPaint paintForRasterizer;
    if (R(2) == 1) {
        paintForRasterizer = make_paint();
    }
    rasterizerBuilder.addLayer(paintForRasterizer);
    SkAutoTUnref<SkRasterizer> rasterizer(rasterizerBuilder.detachRasterizer());
    paint.setRasterizer(rasterizer);
    paint.setImageFilter(make_image_filter());
    SkAutoDataUnref data(make_3Dlut(nullptr, make_bool(), make_bool(), make_bool()));
    SkAutoTUnref<SkAnnotation> annotation(
        SkAnnotation::Create(make_string().c_str(), data));
    paint.setAnnotation(annotation);
    paint.setTextAlign(make_paint_align());
    paint.setTextSize(make_scalar());
    paint.setTextScaleX(make_scalar());
    paint.setTextSkewX(make_scalar());
    paint.setTextEncoding(make_paint_text_encoding());
    return paint;
}
开发者ID:Crawping,项目名称:chromium_extract,代码行数:49,代码来源:SampleFilterFuzz.cpp

示例4: annotate_paint

static void annotate_paint(SkPaint& paint, const char* key, SkData* value) {
    paint.setAnnotation(SkAnnotation::Create(key, value))->unref();
}
开发者ID:Crawping,项目名称:chromium_extract,代码行数:3,代码来源:SkAnnotation.cpp


注:本文中的SkPaint::setAnnotation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。