本文整理汇总了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;
}
示例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);
}
示例3: SkDELETE
SkScalerContext::~SkScalerContext() {
SkDELETE(fNextContext);
fPathEffect->safeUnref();
fMaskFilter->safeUnref();
fRasterizer->safeUnref();
}
示例4: SkDELETE
SkScalerContext::~SkScalerContext() {
SkDELETE(fNextContext);
SkSafeUnref(fPathEffect);
SkSafeUnref(fMaskFilter);
SkSafeUnref(fRasterizer);
}
示例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;
}
}
示例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);
}
}
示例7: SkDELETE
~DeviceCM() {
if (NULL != fDevice) {
fDevice->unlockPixels();
fDevice->unref();
}
SkDELETE(fPaint);
}
示例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;
}
示例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;
}
}
示例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;
}
示例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;
}
示例12: while
Sk3DView::~Sk3DView() {
Rec* rec = fRec;
while (rec != &fInitialRec) {
Rec* next = rec->fNext;
SkDELETE(rec);
rec = next;
}
}
示例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;
}
示例14: SkASSERT
void Sk3DView::restore() {
fMutex.acquire();
SkASSERT(fRec != &fInitialRec);
Rec* next = fRec->fNext;
SkDELETE(fRec);
fRec = next;
fMutex.release();
}
示例15: SkDELETE
void SkAnimator::initialize() {
SkDELETE(fMaker);
fMaker = SkNEW_ARGS(SkAnimateMaker, (this, NULL, NULL));
decodeMemory(gMathPrimer, sizeof(gMathPrimer)-1);
#ifdef ANDROID
InitializeSkExtraPathEffects(this);
#endif
}