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


C++ SkRefCnt_SafeAssign函数代码示例

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


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

示例1: alloc

bool SkImageRef_ashmem::onDecode(SkImageDecoder* codec, SkStreamRewindable* stream,
                                 SkBitmap* bitmap, SkBitmap::Config config,
                                 SkImageDecoder::Mode mode) {

    if (SkImageDecoder::kDecodeBounds_Mode == mode) {
        return this->INHERITED::onDecode(codec, stream, bitmap, config, mode);
    }

    // Ashmem memory is guaranteed to be initialized to 0.
    codec->setSkipWritingZeroes(true);

    AshmemAllocator alloc(&fRec, this->getURI());

    codec->setAllocator(&alloc);
    bool success = this->INHERITED::onDecode(codec, stream, bitmap, config,
                                             mode);
    // remove the allocator, since its on the stack
    codec->setAllocator(NULL);

    if (success) {
        // remember the colortable (if any)
        SkRefCnt_SafeAssign(fCT, bitmap->getColorTable());
        return true;
    } else {
        if (fRec.fPinned) {
            ashmem_unpin_region(fRec.fFD, 0, 0);
            fRec.fPinned = false;
        }
        this->closeFD();
        return false;
    }
}
开发者ID:91yuan,项目名称:bones,代码行数:32,代码来源:SkImageRef_ashmem.cpp

示例2: SkRefCnt_SafeAssign

void SkWriteBuffer::setBitmapHeap(SkBitmapHeap* bitmapHeap) {
    SkRefCnt_SafeAssign(fBitmapHeap, bitmapHeap);
    if (bitmapHeap != NULL) {
        SkASSERT(NULL == fPixelSerializer);
        fPixelSerializer.reset(NULL);
    }
}
开发者ID:Arternis,项目名称:skia,代码行数:7,代码来源:SkWriteBuffer.cpp

示例3: SkRefCnt_SafeAssign

SkNamedFactorySet* SkOrderedWriteBuffer::setNamedFactoryRecorder(SkNamedFactorySet* rec) {
    SkRefCnt_SafeAssign(fNamedFactorySet, rec);
    if (fFactorySet != NULL) {
        fFactorySet->unref();
        fFactorySet = NULL;
    }
    return rec;
}
开发者ID:bunhere,项目名称:skia,代码行数:8,代码来源:SkOrderedWriteBuffer.cpp

示例4: doPreDraw

 void doPreDraw(SkColorFilter* colorFilters[], int nFilters) {
     // Create a chain of ImageFilters from colorFilters
     fImageFilter = nullptr;
     for(int i = nFilters; i --> 0;) {
         SkAutoTUnref<SkImageFilter> filter(
                     SkColorFilterImageFilter::Create(colorFilters[i], fImageFilter, nullptr)
         );
         SkRefCnt_SafeAssign(fImageFilter, filter.get());
     }
 }
开发者ID:jagannathanraman,项目名称:skia,代码行数:10,代码来源:ImageFilterCollapse.cpp

示例5: SkASSERT

void GrRenderTarget::setLastDrawTarget(GrDrawTarget* dt) {
    if (fLastDrawTarget) {
        // The non-MDB world never closes so we can't check this condition
#ifdef ENABLE_MDB
        SkASSERT(fLastDrawTarget->isClosed());
#endif
        fLastDrawTarget->clearRT();
    }

    SkRefCnt_SafeAssign(fLastDrawTarget, dt);
}
开发者ID:03050903,项目名称:skia,代码行数:11,代码来源:GrRenderTarget.cpp

示例6: SkDebugCanvas

void SkDebugger::loadPicture(SkPicture* picture) {
    fPictureWidth = picture->width();
    fPictureHeight = picture->height();
    delete fDebugCanvas;
    fDebugCanvas = new SkDebugCanvas(fPictureWidth, fPictureHeight);
    fDebugCanvas->setBounds(fPictureWidth, fPictureHeight);
    fDebugCanvas->setPicture(picture);
    picture->draw(fDebugCanvas);
    fDebugCanvas->setPicture(NULL);
    fIndex = fDebugCanvas->getSize() - 1;
    SkRefCnt_SafeAssign(fPicture, picture);
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:12,代码来源:SkDebugger.cpp

示例7: SkRefCnt_SafeAssign

SkListSource* SkListView::setListSource(SkListSource* src)
{
	if (fSource != src)
	{
		SkRefCnt_SafeAssign(fSource, src);
		this->ensureSelectionIsVisible();
		this->inval(NULL);
		
		if (fScrollBar)
			fScrollBar->setTotal(fSource->countRecords());
	}
	return src;
}
开发者ID:ACSOP,项目名称:android_external_skia,代码行数:13,代码来源:SkListWidget.cpp

示例8: SkRefCnt_SafeAssign

FontPlatformData& FontPlatformData::operator=(const FontPlatformData& src)
{
    SkRefCnt_SafeAssign(m_typeface, src.m_typeface);

    m_family = src.m_family;
    m_textSize = src.m_textSize;
    m_fakeBold = src.m_fakeBold;
    m_fakeItalic = src.m_fakeItalic;
    m_harfbuzzFace = src.m_harfbuzzFace;
    m_orientation = src.m_orientation;
    m_textOrientation = src.m_textOrientation;
    m_style = src.m_style;
    m_emSizeInFontUnits = src.m_emSizeInFontUnits;

    return *this;
}
开发者ID:0omega,项目名称:platform_external_webkit,代码行数:16,代码来源:FontPlatformDataLinux.cpp

示例9: SkRefCnt_SafeAssign

SkView::Artist* SkView::setArtist(Artist* obj)
{
	if (obj == NULL)
	{
		this->removeTagList(kViewArtist_SkTagList);
	}
	else	// add/replace
	{
		Artist_SkTagList* rec = (Artist_SkTagList*)this->findTagList(kViewArtist_SkTagList);

		if (rec)
			SkRefCnt_SafeAssign(rec->fArtist, obj);
		else
			this->addTagList(new Artist_SkTagList(obj));
	}
	return obj;
}
开发者ID:ACSOP,项目名称:android_external_skia,代码行数:17,代码来源:SkViewPriv.cpp

示例10: SkRefCnt_SafeAssign

FontPlatformData& FontPlatformData::operator=(const FontPlatformData& data)
{
    if (this != &data) {
        m_font = data.m_font;
        m_size = data.m_size;
        SkRefCnt_SafeAssign(m_typeface, data.m_typeface);
        m_lfQuality = data.m_lfQuality;

        // The following fields will get re-computed if necessary.
        ScriptFreeCache(&m_scriptCache);
        m_scriptCache = 0;

        delete m_scriptFontProperties;
        m_scriptFontProperties = 0;
    } 
    return *this;
}
开发者ID:Moondee,项目名称:Artemis,代码行数:17,代码来源:FontPlatformDataChromiumWin.cpp

示例11: SkRefCnt_SafeAssign

SkBitmap::Allocator* SkImageDecoder::setAllocator(SkBitmap::Allocator* alloc) {
    SkRefCnt_SafeAssign(fAllocator, alloc);
    return alloc;
}
开发者ID:andreicoman11,项目名称:OsmAnd-external-skia,代码行数:4,代码来源:SkImageDecoder.cpp

示例12: SkRefCnt_SafeAssign

SkImageDecoderFactory* SkImageRef::setDecoderFactory(
                                                SkImageDecoderFactory* fact) {
    SkRefCnt_SafeAssign(fFactory, fact);
    return fact;
}
开发者ID:Jimmy0319,项目名称:skia,代码行数:5,代码来源:SkImageRef.cpp

示例13: setSharedHeap

 void setSharedHeap(SkBitmapHeap* heap) {
     SkASSERT(!shouldFlattenBitmaps(fFlags) || NULL == heap);
     SkRefCnt_SafeAssign(fSharedHeap, heap);
     this->updateReader();
 }
开发者ID:JCROM-FxOS,项目名称:b2jc_gecko,代码行数:5,代码来源:SkGPipeRead.cpp

示例14: SkRefCnt_SafeAssign

void DeferredLayerUpdater::setPaint(const SkPaint* paint) {
    OpenGLRenderer::getAlphaAndModeDirect(paint, &mAlpha, &mMode);
    SkColorFilter* colorFilter = (paint) ? paint->getColorFilter() : NULL;
    SkRefCnt_SafeAssign(mColorFilter, colorFilter);
}
开发者ID:AdrianoMartins,项目名称:platform_frameworks_base,代码行数:5,代码来源:DeferredLayerUpdater.cpp

示例15: SkRefCnt_SafeAssign

void Layer::setColorFilter(SkColorFilter* filter) {
    SkRefCnt_SafeAssign(colorFilter, filter);
}
开发者ID:HDragon8,项目名称:platform_frameworks_base,代码行数:3,代码来源:Layer.cpp


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