本文整理汇总了C++中sklayerrasterizer::Builder类的典型用法代码示例。如果您正苦于以下问题:C++ Builder类的具体用法?C++ Builder怎么用?C++ Builder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Builder类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: paint
void
DrawTargetSkia::MaskSurface(const Pattern &aSource,
SourceSurface *aMask,
Point aOffset,
const DrawOptions &aOptions)
{
MarkChanged();
AutoPaintSetup paint(mCanvas.get(), aOptions, aSource);
TempBitmap bitmap = GetBitmapForSurface(aMask);
if (bitmap.mBitmap.colorType() == kAlpha_8_SkColorType) {
mCanvas->drawBitmap(bitmap.mBitmap, aOffset.x, aOffset.y, &paint.mPaint);
} else {
SkPaint maskPaint;
TempBitmap tmpBitmap;
SetPaintPattern(maskPaint, SurfacePattern(aMask, ExtendMode::CLAMP), tmpBitmap);
SkMatrix transform = maskPaint.getShader()->getLocalMatrix();
transform.postTranslate(SkFloatToScalar(aOffset.x), SkFloatToScalar(aOffset.y));
maskPaint.getShader()->setLocalMatrix(transform);
SkLayerRasterizer::Builder builder;
builder.addLayer(maskPaint);
SkAutoTUnref<SkRasterizer> raster(builder.detachRasterizer());
paint.mPaint.setRasterizer(raster.get());
IntSize size = aMask->GetSize();
Rect rect = Rect(aOffset.x, aOffset.y, size.width, size.height);
mCanvas->drawRect(RectToSkRect(rect), paint.mPaint);
}
}
开发者ID:CodeSpeaker,项目名称:gecko-dev,代码行数:31,代码来源:DrawTargetSkia.cpp
示例2: apply_shader
static void apply_shader(SkPaint* paint, int index) {
raster_proc proc = gRastProcs[index];
SkPaint p;
SkLayerRasterizer::Builder rastBuilder;
p.setAntiAlias(true);
proc(&rastBuilder, p);
paint->setRasterizer(rastBuilder.detachRasterizer())->unref();
paint->setColor(SK_ColorBLUE);
}
开发者ID:Adenilson,项目名称:skia,代码行数:10,代码来源:SampleSlides.cpp
示例3: make_paint
static SkPaint make_paint() {
SkPaint paint;
if (fuzz->exhausted()) {
return 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.setFakeBoldText(make_bool());
paint.setDevKernText(make_bool());
paint.setFilterQuality(make_filter_quality());
paint.setStyle(make_paint_style());
paint.setColor(make_color());
paint.setStrokeWidth(make_number(false));
paint.setStrokeMiter(make_number(false));
paint.setStrokeCap(make_paint_cap());
paint.setStrokeJoin(make_paint_join());
paint.setColorFilter(make_color_filter());
paint.setBlendMode(make_blendmode());
paint.setPathEffect(make_path_effect());
paint.setMaskFilter(make_mask_filter());
if (false) {
// our validating buffer does not support typefaces yet, so skip this for now
paint.setTypeface(SkTypeface::MakeFromName(make_font_name().c_str(),make_typeface_style()));
}
SkLayerRasterizer::Builder rasterizerBuilder;
SkPaint paintForRasterizer;
if (make_bool()) {
paintForRasterizer = make_paint();
}
rasterizerBuilder.addLayer(paintForRasterizer);
paint.setRasterizer(rasterizerBuilder.detach());
paint.setImageFilter(make_image_filter());
bool a, b, c;
fuzz->next(&a, &b, &c);
sk_sp<SkData> data(make_3Dlut(nullptr, a, b, c));
paint.setTextAlign(make_paint_align());
SkScalar d, e, f;
fuzz->next(&d, &e, &f);
paint.setTextSize(d);
paint.setTextScaleX(e);
paint.setTextSkewX(f);
paint.setTextEncoding(make_paint_text_encoding());
return paint;
}
开发者ID:MIPS,项目名称:external-skia,代码行数:53,代码来源:FilterFuzz.cpp
示例4: 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());
if (false) {
// our validating buffer does not support typefaces yet, so skip this for now
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);
paint.setRasterizer(rasterizerBuilder.detach());
paint.setImageFilter(make_image_filter());
sk_sp<SkData> data(make_3Dlut(nullptr, make_bool(), make_bool(), make_bool()));
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:blizardxsi,项目名称:123,代码行数:50,代码来源:SampleFilterFuzz.cpp
示例5: apply_shader
static void apply_shader(SkPaint* paint, int index) {
raster_proc proc = gRastProcs[index];
if (proc)
{
SkPaint p;
SkLayerRasterizer::Builder rastBuilder;
p.setAntiAlias(true);
proc(&rastBuilder, p);
paint->setRasterizer(rastBuilder.detachRasterizer())->unref();
}
#if 0
SkScalar dir[] = { SK_Scalar1, SK_Scalar1, SK_Scalar1 };
paint->setMaskFilter(SkBlurMaskFilter::CreateEmboss(dir, SK_Scalar1/4, SkIntToScalar(4), SkIntToScalar(3)))->unref();
#endif
paint->setColor(SK_ColorBLUE);
}
开发者ID:Arternis,项目名称:skia,代码行数:18,代码来源:texteffects.cpp
示例6: refRasterizer
virtual SkRasterizer* refRasterizer() {
return fBuilder.snapshotRasterizer();
}
开发者ID:1477584437,项目名称:platform_frameworks_base,代码行数:3,代码来源:Rasterizer.cpp
注:本文中的sklayerrasterizer::Builder类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论