本文整理汇总了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;
}
}
示例2: SkRefCnt_SafeAssign
void SkWriteBuffer::setBitmapHeap(SkBitmapHeap* bitmapHeap) {
SkRefCnt_SafeAssign(fBitmapHeap, bitmapHeap);
if (bitmapHeap != NULL) {
SkASSERT(NULL == fPixelSerializer);
fPixelSerializer.reset(NULL);
}
}
示例3: SkRefCnt_SafeAssign
SkNamedFactorySet* SkOrderedWriteBuffer::setNamedFactoryRecorder(SkNamedFactorySet* rec) {
SkRefCnt_SafeAssign(fNamedFactorySet, rec);
if (fFactorySet != NULL) {
fFactorySet->unref();
fFactorySet = NULL;
}
return rec;
}
示例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());
}
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例11: SkRefCnt_SafeAssign
SkBitmap::Allocator* SkImageDecoder::setAllocator(SkBitmap::Allocator* alloc) {
SkRefCnt_SafeAssign(fAllocator, alloc);
return alloc;
}
示例12: SkRefCnt_SafeAssign
SkImageDecoderFactory* SkImageRef::setDecoderFactory(
SkImageDecoderFactory* fact) {
SkRefCnt_SafeAssign(fFactory, fact);
return fact;
}
示例13: setSharedHeap
void setSharedHeap(SkBitmapHeap* heap) {
SkASSERT(!shouldFlattenBitmaps(fFlags) || NULL == heap);
SkRefCnt_SafeAssign(fSharedHeap, heap);
this->updateReader();
}
示例14: SkRefCnt_SafeAssign
void DeferredLayerUpdater::setPaint(const SkPaint* paint) {
OpenGLRenderer::getAlphaAndModeDirect(paint, &mAlpha, &mMode);
SkColorFilter* colorFilter = (paint) ? paint->getColorFilter() : NULL;
SkRefCnt_SafeAssign(mColorFilter, colorFilter);
}
示例15: SkRefCnt_SafeAssign
void Layer::setColorFilter(SkColorFilter* filter) {
SkRefCnt_SafeAssign(colorFilter, filter);
}