本文整理汇总了C++中SkSafeUnref函数的典型用法代码示例。如果您正苦于以下问题:C++ SkSafeUnref函数的具体用法?C++ SkSafeUnref怎么用?C++ SkSafeUnref使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SkSafeUnref函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SkSafeUnref
SkComposeShader::~SkComposeShader() {
SkSafeUnref(fMode);
fShaderB->unref();
fShaderA->unref();
}
示例2: SkSafeUnref
SkBoundaryPatch::~SkBoundaryPatch() {
SkSafeUnref(fBoundary);
}
示例3: SkSafeUnref
SkGLContext::~SkGLContext() {
SkSafeUnref(fGL);
}
示例4: SkSafeUnref
PictureLayerContent::~PictureLayerContent()
{
SkSafeUnref(m_picture);
}
示例5: sk_free
SkGradientShaderBase::GradientShaderCache::~GradientShaderCache() {
sk_free(fCache16Storage);
SkSafeUnref(fCache32PixelRef);
}
示例6: setTypeface
static void setTypeface(SkPaint* paint, const char name[], SkTypeface::Style style) {
SkSafeUnref(paint->setTypeface(SkTypeface::CreateFromName(name, style)));
}
示例7: SkSafeUnref
PictureBenchmark::~PictureBenchmark() {
SkSafeUnref(fRenderer);
}
示例8: finalizer
static void finalizer(JNIEnv* env, jobject, jlong objHandle)
{
SkXfermode* obj = reinterpret_cast<SkXfermode *>(objHandle);
SkSafeUnref(obj);
}
示例9: SkSafeUnref
SkPairPathEffect::~SkPairPathEffect() {
SkSafeUnref(fPE0);
SkSafeUnref(fPE1);
}
示例10: SkSafeUnref
virtual ~AnimGifView()
{
SkSafeUnref(fMovie);
}
示例11: SetPaintPattern
static void
SetPaintPattern(SkPaint& aPaint, const Pattern& aPattern, TempBitmap& aTmpBitmap,
Float aAlpha = 1.0)
{
switch (aPattern.GetType()) {
case PatternType::COLOR: {
Color color = static_cast<const ColorPattern&>(aPattern).mColor;
aPaint.setColor(ColorToSkColor(color, aAlpha));
break;
}
case PatternType::LINEAR_GRADIENT: {
const LinearGradientPattern& pat = static_cast<const LinearGradientPattern&>(aPattern);
GradientStopsSkia *stops = static_cast<GradientStopsSkia*>(pat.mStops.get());
SkShader::TileMode mode = ExtendModeToTileMode(stops->mExtendMode);
if (stops->mCount >= 2) {
SkPoint points[2];
points[0] = SkPoint::Make(SkFloatToScalar(pat.mBegin.x), SkFloatToScalar(pat.mBegin.y));
points[1] = SkPoint::Make(SkFloatToScalar(pat.mEnd.x), SkFloatToScalar(pat.mEnd.y));
SkShader* shader = SkGradientShader::CreateLinear(points,
&stops->mColors.front(),
&stops->mPositions.front(),
stops->mCount,
mode);
if (shader) {
SkMatrix mat;
GfxMatrixToSkiaMatrix(pat.mMatrix, mat);
shader->setLocalMatrix(mat);
SkSafeUnref(aPaint.setShader(shader));
}
} else {
aPaint.setColor(SkColorSetARGB(0, 0, 0, 0));
}
break;
}
case PatternType::RADIAL_GRADIENT: {
const RadialGradientPattern& pat = static_cast<const RadialGradientPattern&>(aPattern);
GradientStopsSkia *stops = static_cast<GradientStopsSkia*>(pat.mStops.get());
SkShader::TileMode mode = ExtendModeToTileMode(stops->mExtendMode);
if (stops->mCount >= 2) {
SkPoint points[2];
points[0] = SkPoint::Make(SkFloatToScalar(pat.mCenter1.x), SkFloatToScalar(pat.mCenter1.y));
points[1] = SkPoint::Make(SkFloatToScalar(pat.mCenter2.x), SkFloatToScalar(pat.mCenter2.y));
SkShader* shader = SkGradientShader::CreateTwoPointConical(points[0],
SkFloatToScalar(pat.mRadius1),
points[1],
SkFloatToScalar(pat.mRadius2),
&stops->mColors.front(),
&stops->mPositions.front(),
stops->mCount,
mode);
if (shader) {
SkMatrix mat;
GfxMatrixToSkiaMatrix(pat.mMatrix, mat);
shader->setLocalMatrix(mat);
SkSafeUnref(aPaint.setShader(shader));
}
} else {
aPaint.setColor(SkColorSetARGB(0, 0, 0, 0));
}
break;
}
case PatternType::SURFACE: {
const SurfacePattern& pat = static_cast<const SurfacePattern&>(aPattern);
aTmpBitmap = GetBitmapForSurface(pat.mSurface);
const SkBitmap& bitmap = aTmpBitmap.mBitmap;
SkShader::TileMode mode = ExtendModeToTileMode(pat.mExtendMode);
SkShader* shader = SkShader::CreateBitmapShader(bitmap, mode, mode);
SkMatrix mat;
GfxMatrixToSkiaMatrix(pat.mMatrix, mat);
shader->setLocalMatrix(mat);
SkSafeUnref(aPaint.setShader(shader));
if (pat.mFilter == Filter::POINT) {
aPaint.setFilterLevel(SkPaint::kNone_FilterLevel);
}
break;
}
}
}
示例12: SkSafeUnref
SkImageDecoder::~SkImageDecoder() {
SkSafeUnref(fPeeker);
SkSafeUnref(fChooser);
SkSafeUnref(fAllocator);
}
示例13: SkSafeUnref
virtual ~ComposeShaderGM() {
SkSafeUnref(fShader);
}
示例14: sk_free
SkReadBuffer::~SkReadBuffer() {
sk_free(fMemoryPtr);
SkSafeUnref(fBitmapStorage);
}
示例15: SkSafeUnref
SkColorFilterImageFilter::~SkColorFilterImageFilter() {
SkSafeUnref(fColorFilter);
}