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


C++ SkDELETE函数代码示例

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


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

示例1: openStream

    // overrides
    virtual SkStream* openStream()
    {
        SkStream* stream = SkNEW_ARGS(SkMMAPStream, (fPath.c_str()));

        // check for failure
        if (stream->getLength() <= 0) {
            SkDELETE(stream);
            // maybe MMAP isn't supported. try FILE
            stream = SkNEW_ARGS(SkFILEStream, (fPath.c_str()));
            if (stream->getLength() <= 0) {
                SkDELETE(stream);
                stream = NULL;
            }
        }
        return stream;
    }
开发者ID:jiezh,项目名称:h5vcc,代码行数:17,代码来源:SkFontHost_linux.cpp

示例2: bench_record

static void bench_record(SkPicture* src, const char* name, SkBBHFactory* bbhFactory) {
    BenchTimer timer;
    timer.start();
    const int width  = src ? src->width()  : FLAGS_nullSize;
    const int height = src ? src->height() : FLAGS_nullSize;

    for (int i = 0; i < FLAGS_loops; i++) {
        if (FLAGS_skr) {
            EXPERIMENTAL::SkRecording recording(width, height);
            if (NULL != src) {
                src->draw(recording.canvas());
            }
            // Release and delete the SkPlayback so that recording optimizes its SkRecord.
            SkDELETE(recording.releasePlayback());
        } else {
            SkPictureRecorder recorder;
            SkCanvas* canvas = recorder.beginRecording(width, height, bbhFactory, FLAGS_flags);
            if (NULL != src) {
                src->draw(canvas);
            }
            if (FLAGS_endRecording) {
                SkAutoTUnref<SkPicture> dst(recorder.endRecording());
            }
        }
    }
    timer.end();

    const double msPerLoop = timer.fCpu / (double)FLAGS_loops;
    printf("%f\t%s\n", scale_time(msPerLoop), name);
}
开发者ID:Jimmy0319,项目名称:skia,代码行数:30,代码来源:bench_record.cpp

示例3: SkDELETE

SkScalerContext::~SkScalerContext() {
    SkDELETE(fNextContext);

    fPathEffect->safeUnref();
    fMaskFilter->safeUnref();
    fRasterizer->safeUnref();
}
开发者ID:writerskie,项目名称:ff,代码行数:7,代码来源:SkScalerContext.cpp

示例4: SkDELETE

SkScalerContext::~SkScalerContext() {
    SkDELETE(fNextContext);

    SkSafeUnref(fPathEffect);
    SkSafeUnref(fMaskFilter);
    SkSafeUnref(fRasterizer);
}
开发者ID:Lloir-Mod,项目名称:platform_external_skia,代码行数:7,代码来源:SkScalerContext.cpp

示例5: while

void SkTLS::Delete(CreateProc createProc) {
    if (NULL == createProc) {
        return;
    }
    
    void* ptr = SkTLS::PlatformGetSpecific(false);
    
    SkTLSRec* curr = (SkTLSRec*)ptr;
    SkTLSRec* prev = NULL;
    while (curr) {
        SkTLSRec* next = curr->fNext;
        if (curr->fCreateProc == createProc) {
            if (prev) {
                prev->fNext = next;
            } else {
                // we have a new head of our chain
                SkTLS::PlatformSetSpecific(next);
            }
            SkDELETE(curr);
            break;
        }
        prev = curr;
        curr = next;
    }
}
开发者ID:Beifeng,项目名称:WTL-DUI,代码行数:25,代码来源:SkTLS.cpp

示例6: SkNEW_ARGS

void SkPicture::serialize(SkWStream* stream, EncodeBitmap encoder) const {
    SkPicturePlayback* playback = fPlayback;

    if (NULL == playback && fRecord) {
        playback = SkNEW_ARGS(SkPicturePlayback, (*fRecord));
    }

    SkPictInfo info;

    info.fVersion = PICTURE_VERSION;
    info.fWidth = fWidth;
    info.fHeight = fHeight;
    info.fFlags = SkPictInfo::kCrossProcess_Flag;
#ifdef SK_SCALAR_IS_FLOAT
    info.fFlags |= SkPictInfo::kScalarIsFloat_Flag;
#endif
    if (8 == sizeof(void*)) {
        info.fFlags |= SkPictInfo::kPtrIs64Bit_Flag;
    }

    stream->write(&info, sizeof(info));
    if (playback) {
        stream->writeBool(true);
        playback->serialize(stream, encoder);
        // delete playback if it is a local version (i.e. cons'd up just now)
        if (playback != fPlayback) {
            SkDELETE(playback);
        }
    } else {
        stream->writeBool(false);
    }
}
开发者ID:RobbinZhu,项目名称:context2d,代码行数:32,代码来源:SkPicture.cpp

示例7: SkDELETE

	~DeviceCM() {
        if (NULL != fDevice) {
            fDevice->unlockPixels();
            fDevice->unref();
        }
		SkDELETE(fPaint);
	}
开发者ID:Androtos,项目名称:toolchain_benchmark,代码行数:7,代码来源:SkCanvas.cpp

示例8: SkDELETE

SkCanvas* SkPicture::beginRecording(int width, int height,
                                    uint32_t recordingFlags) {
    if (fPlayback) {
        SkDELETE(fPlayback);
        fPlayback = NULL;
    }

    if (NULL != fRecord) {
        fRecord->unref();
        fRecord = NULL;
    }

    SkBitmap bm;
    bm.setConfig(SkBitmap::kNo_Config, width, height);
    SkAutoTUnref<SkDevice> dev(SkNEW_ARGS(SkDevice, (bm)));

    // Must be set before calling createBBoxHierarchy
    fWidth = width;
    fHeight = height;

    if (recordingFlags & kOptimizeForClippedPlayback_RecordingFlag) {
        SkBBoxHierarchy* tree = this->createBBoxHierarchy();
        SkASSERT(NULL != tree);
        fRecord = SkNEW_ARGS(SkBBoxHierarchyRecord, (recordingFlags, tree, dev));
        tree->unref();
    } else {
        fRecord = SkNEW_ARGS(SkPictureRecord, (recordingFlags, dev));
    }
    fRecord->beginRecording();

    return fRecord;
}
开发者ID:RobbinZhu,项目名称:context2d,代码行数:32,代码来源:SkPicture.cpp

示例9: SkASSERT

// Remove the specified atlas from the cache
void GrTextureStripAtlas::CleanUp(const GrContext*, void* info) {
    SkASSERT(NULL != info);

    AtlasEntry* entry = static_cast<AtlasEntry*>(info);

    // remove the cache entry
    GetCache()->remove(entry->fKey, entry);

    // remove the actual entry
    SkDELETE(entry);

    if (0 == GetCache()->count()) {
        SkDELETE(gAtlasCache);
        gAtlasCache = NULL;
    }
}
开发者ID:CodeSpeaker,项目名称:gecko-dev,代码行数:17,代码来源:GrTextureStripAtlas.cpp

示例10: SkASSERT

void GrContext::initMockContext() {
    SkASSERT(NULL == fGpu);
    fGpu = SkNEW_ARGS(MockGpu, (this));
    SkASSERT(fGpu);
    this->initCommon();

    // We delete these because we want to test the cache starting with zero resources. Also, none of
    // these objects are required for any of tests that use this context. TODO: make stop allocating
    // resources in the buffer pools.
    SkDELETE(fDrawBuffer);
    SkDELETE(fDrawBufferVBAllocPool);
    SkDELETE(fDrawBufferIBAllocPool);

    fDrawBuffer = NULL;
    fDrawBufferVBAllocPool = NULL;
    fDrawBufferIBAllocPool = NULL;
}
开发者ID:china20,项目名称:skia,代码行数:17,代码来源:GrTest.cpp

示例11: SkASSERT

void GrGpuGL::ProgramCache::abandon() {
    for (int i = 0; i < fCount; ++i) {
        SkASSERT(fEntries[i]->fProgram.get());
        fEntries[i]->fProgram->abandon();
        SkDELETE(fEntries[i]);
    }
    fCount = 0;
}
开发者ID:RobinWuDev,项目名称:Qt,代码行数:8,代码来源:GrGpuGL_program.cpp

示例12: while

Sk3DView::~Sk3DView() {
    Rec* rec = fRec;
    while (rec != &fInitialRec) {
        Rec* next = rec->fNext;
        SkDELETE(rec);
        rec = next;
    }
}
开发者ID:Tkkg1994,项目名称:Platfrom-kccat6,代码行数:8,代码来源:SkCamera.cpp

示例13: SkDELETE

void SkPixelRef::addGenIDChangeListener(GenIDChangeListener* listener) {
    if (NULL == listener || !fUniqueGenerationID) {
        // No point in tracking this if we're not going to call it.
        SkDELETE(listener);
        return;
    }
    *fGenIDChangeListeners.append() = listener;
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:8,代码来源:SkPixelRef.cpp

示例14: SkASSERT

void Sk3DView::restore() {
    fMutex.acquire();
    SkASSERT(fRec != &fInitialRec);
    Rec* next = fRec->fNext;
    SkDELETE(fRec);
    fRec = next;
    fMutex.release();
}
开发者ID:Tkkg1994,项目名称:Platfrom-kccat6,代码行数:8,代码来源:SkCamera.cpp

示例15: SkDELETE

void SkAnimator::initialize() {
    SkDELETE(fMaker);
    fMaker = SkNEW_ARGS(SkAnimateMaker, (this, NULL, NULL));
    decodeMemory(gMathPrimer, sizeof(gMathPrimer)-1);
#ifdef ANDROID
    InitializeSkExtraPathEffects(this);
#endif
}
开发者ID:AliFarahnak,项目名称:XobotOS,代码行数:8,代码来源:SkAnimator.cpp


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