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


C++ SkSafeUnref函数代码示例

本文整理汇总了C++中SkSafeUnref函数的典型用法代码示例。如果您正苦于以下问题:C++ SkSafeUnref函数的具体用法?C++ SkSafeUnref怎么用?C++ SkSafeUnref使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: SkSafeUnref

SkComposeShader::~SkComposeShader() {
    SkSafeUnref(fMode);
    fShaderB->unref();
    fShaderA->unref();
}
开发者ID:3rdexp,项目名称:soui,代码行数:5,代码来源:SkComposeShader.cpp

示例2: SkSafeUnref

SkBoundaryPatch::~SkBoundaryPatch() {
    SkSafeUnref(fBoundary);
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:3,代码来源:SkBoundaryPatch.cpp

示例3: SkSafeUnref

SkGLContext::~SkGLContext() {
    SkSafeUnref(fGL);
}
开发者ID:AliFarahnak,项目名称:XobotOS,代码行数:3,代码来源:SkGLContext.cpp

示例4: SkSafeUnref

PictureLayerContent::~PictureLayerContent()
{
    SkSafeUnref(m_picture);
}
开发者ID:a33g-dev,项目名称:platform_samsung,代码行数:4,代码来源:PictureLayerContent.cpp

示例5: sk_free

SkGradientShaderBase::GradientShaderCache::~GradientShaderCache() {
    sk_free(fCache16Storage);
    SkSafeUnref(fCache32PixelRef);
}
开发者ID:tachen,项目名称:skia,代码行数:4,代码来源:SkGradientShader.cpp

示例6: setTypeface

static void setTypeface(SkPaint* paint, const char name[], SkTypeface::Style style) {
    SkSafeUnref(paint->setTypeface(SkTypeface::CreateFromName(name, style)));
}
开发者ID:Adenilson,项目名称:skia,代码行数:3,代码来源:downsamplebitmap.cpp

示例7: SkSafeUnref

PictureBenchmark::~PictureBenchmark() {
    SkSafeUnref(fRenderer);
}
开发者ID:webbjiang,项目名称:skia,代码行数:3,代码来源:PictureBenchmark.cpp

示例8: finalizer

 static void finalizer(JNIEnv* env, jobject, jlong objHandle)
 {
     SkXfermode* obj = reinterpret_cast<SkXfermode *>(objHandle);
     SkSafeUnref(obj);
 }
开发者ID:0359xiaodong,项目名称:platform_frameworks_base,代码行数:5,代码来源:Xfermode.cpp

示例9: SkSafeUnref

SkPairPathEffect::~SkPairPathEffect() {
    SkSafeUnref(fPE0);
    SkSafeUnref(fPE1);
}
开发者ID:CodeSpeaker,项目名称:gecko-dev,代码行数:4,代码来源:SkPathEffect.cpp

示例10: SkSafeUnref

 virtual ~AnimGifView()
     {
     SkSafeUnref(fMovie);
     }
开发者ID:CoryXie,项目名称:SkiWin,代码行数:4,代码来源:SampleMovie.cpp

示例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;
    }
  }
}
开发者ID:CodeSpeaker,项目名称:gecko-dev,代码行数:86,代码来源:DrawTargetSkia.cpp

示例12: SkSafeUnref

SkImageDecoder::~SkImageDecoder() {
    SkSafeUnref(fPeeker);
    SkSafeUnref(fChooser);
    SkSafeUnref(fAllocator);
}
开发者ID:AliFarahnak,项目名称:XobotOS,代码行数:5,代码来源:SkImageDecoder.cpp

示例13: SkSafeUnref

 virtual ~ComposeShaderGM() {
     SkSafeUnref(fShader);
 }
开发者ID:Just-D,项目名称:skia,代码行数:3,代码来源:composeshader.cpp

示例14: sk_free

SkReadBuffer::~SkReadBuffer() {
    sk_free(fMemoryPtr);
    SkSafeUnref(fBitmapStorage);
}
开发者ID:Jimmy0319,项目名称:skia,代码行数:4,代码来源:SkReadBuffer.cpp

示例15: SkSafeUnref

SkColorFilterImageFilter::~SkColorFilterImageFilter() {
    SkSafeUnref(fColorFilter);
}
开发者ID:435420057,项目名称:soui,代码行数:3,代码来源:SkColorFilterImageFilter.cpp


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