• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ sk_atomic_inc函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: next_id

static int32_t next_id() {
    int32_t id;
    do {
        id = sk_atomic_inc(&gNextID);
    } while (id == SK_InvalidGenID);
    return id;
}
开发者ID:sheuan,项目名称:skia,代码行数:7,代码来源:GrContext.cpp


示例2: globalRef

void AndroidPixelRef::globalRef(void* localref) {
    if (fWrappedPixelRef) {
        // delegate java obj management to the wrapped ref
        fWrappedPixelRef->globalRef(localref);

        // Note: we only ref and unref the wrapped AndroidPixelRef so that
        // bitmap->pixelRef()->globalRef() and globalUnref() can be used in a pair, even if
        // the bitmap has its underlying AndroidPixelRef swapped out/wrapped
        return;
    }
    if (fOnJavaHeap && sk_atomic_inc(&fGlobalRefCnt) == 0) {
        JNIEnv *env = vm2env(fVM);

        // If JNI ref was passed, it is always used
        if (localref) fStorageObj = (jbyteArray) localref;

        if (fStorageObj == NULL) {
            SkDebugf("No valid local ref to create a JNI global ref\n");
            sk_throw();
        }
        if (fHasGlobalRef) {
            // This should never happen
            SkDebugf("Already holding a JNI global ref");
            sk_throw();
        }

        fStorageObj = (jbyteArray) env->NewGlobalRef(fStorageObj);
        // TODO: Check for failure here
        fHasGlobalRef = true;
    }
    ref();
}
开发者ID:lovelifer,项目名称:graduate,代码行数:32,代码来源:Graphics.cpp


示例3: fColorLUT

SkColorSpace::SkColorSpace(SkColorLookUpTable* colorLUT, sk_sp<SkGammas> gammas,
                           const SkMatrix44& toXYZD50)
    : fColorLUT(colorLUT)
    , fGammas(gammas)
    , fToXYZD50(toXYZD50)
    , fUniqueID(sk_atomic_inc(&gUniqueColorSpaceID))
    , fNamed(kUnknown_Named)
{}
开发者ID:C-Tillion,项目名称:skia,代码行数:8,代码来源:SkColorSpace.cpp


示例4: CreateUniqueID

uint32_t GrProgramElement::CreateUniqueID() {
    static int32_t gUniqueID = SK_InvalidUniqueID;
    uint32_t id;
    do {
        id = static_cast<uint32_t>(sk_atomic_inc(&gUniqueID) + 1);
    } while (id == SK_InvalidUniqueID);
    return id;
}
开发者ID:DXGL,项目名称:skia,代码行数:8,代码来源:GrProgramElement.cpp


示例5: CreateUniqueID

uint32_t GrDrawTargetCaps::CreateUniqueID() {
    static int32_t gUniqueID = SK_InvalidUniqueID;
    uint32_t id;
    do {
        id = static_cast<uint32_t>(sk_atomic_inc(&gUniqueID) + 1);
    } while (id == SK_InvalidUniqueID);
    return id;
}
开发者ID:RobinWuDev,项目名称:Qt,代码行数:8,代码来源:GrDrawTarget.cpp


示例6: sk_atomic_inc

SkOSMenu::Item::Item(const char label[], SkOSMenu::Type type,
                     const char slotName[], SkEvent* evt) {
    fLabel.set(label);
    fSlotName.set(slotName);
    fType = type;
    fEvent = evt;
    fKey = 0;
    fID = sk_atomic_inc(&gOSMenuCmd);
}
开发者ID:mariospr,项目名称:chromium-browser,代码行数:9,代码来源:SkOSMenu.cpp


示例7: next_image_filter_unique_id

static int32_t next_image_filter_unique_id() {
    static int32_t gImageFilterUniqueID;

    // Never return 0.
    int32_t id;
    do {
        id = sk_atomic_inc(&gImageFilterUniqueID) + 1;
    } while (0 == id);
    return id;
}
开发者ID:Dnnono,项目名称:skia,代码行数:10,代码来源:SkImageFilter.cpp


示例8: sk_atomic_inc

SkPicture::AccelData::Domain SkPicture::AccelData::GenerateDomain() {
    static int32_t gNextID = 0;

    int32_t id = sk_atomic_inc(&gNextID);
    if (id >= 1 << (8 * sizeof(Domain))) {
        SK_CRASH();
    }

    return static_cast<Domain>(id);
}
开发者ID:UIKit0,项目名称:skia,代码行数:10,代码来源:SkPicture.cpp


示例9: sk_atomic_inc

GrCacheID::Domain GrCacheID::GenerateDomain() {
    static int32_t gNextDomain = kInvalid_Domain + 1;

    int32_t domain = sk_atomic_inc(&gNextDomain);
    if (domain >= 1 << (8 * sizeof(Domain))) {
        GrCrash("Too many Cache Domains");
    }

    return static_cast<Domain>(domain);
}
开发者ID:CodeSpeaker,项目名称:gecko-dev,代码行数:10,代码来源:GrCacheID.cpp


示例10: get_default_mutex

SkBaseMutex* get_default_mutex() {
#ifdef PIXELREF_MUTEX_RING_COUNT
    // atomic_inc might be overkill here. It may be fine if once in a while
    // we hit a race-condition and two subsequent calls get the same index...
    int index = sk_atomic_inc(&gPixelRefMutexRingIndex);
    return &gPixelRefMutexRing[index & (PIXELREF_MUTEX_RING_COUNT - 1)];
#else
    return &gPixelRefMutex;
#endif
}
开发者ID:jrmuizel,项目名称:image-scaling,代码行数:10,代码来源:SkPixelRef.cpp


示例11: sk_atomic_inc

GrResourceKey::ResourceType GrResourceKey::GenerateResourceType() {
    static int32_t gNextType = 0;

    int32_t type = sk_atomic_inc(&gNextType);
    if (type >= (1 << 8 * sizeof(ResourceType))) {
        SkFAIL("Too many Resource Types");
    }

    return static_cast<ResourceType>(type);
}
开发者ID:iHaD,项目名称:skia,代码行数:10,代码来源:GrResourceCache.cpp


示例12: sk_atomic_inc

uint32_t SkImage::NextUniqueID() {
    static int32_t gUniqueID;

    // never return 0;
    uint32_t id;
    do {
        id = sk_atomic_inc(&gUniqueID) + 1;
    } while (0 == id);
    return id;
}
开发者ID:Tkkg1994,项目名称:Platfrom-kccat6,代码行数:10,代码来源:SkImage.cpp


示例13: get_default_mutex

static SkBaseMutex* get_default_mutex() {
    static int32_t gPixelRefMutexRingIndex;

    SkASSERT(SkIsPow2(PIXELREF_MUTEX_RING_COUNT));

    // atomic_inc might be overkill here. It may be fine if once in a while
    // we hit a race-condition and two subsequent calls get the same index...
    int index = sk_atomic_inc(&gPixelRefMutexRingIndex);
    return &gPixelRefMutexRing[index & (PIXELREF_MUTEX_RING_COUNT - 1)];
}
开发者ID:mariospr,项目名称:chromium-browser,代码行数:10,代码来源:SkPixelRef.cpp


示例14: sk_atomic_inc

GrScratchKey::ResourceType GrScratchKey::GenerateResourceType() {
    static int32_t gType = INHERITED::kInvalidDomain + 1;

    int32_t type = sk_atomic_inc(&gType);
    if (type > SK_MaxU16) {
        SkFAIL("Too many Resource Types");
    }

    return static_cast<ResourceType>(type);
}
开发者ID:jszwedko,项目名称:skia,代码行数:10,代码来源:GrResourceCache.cpp


示例15: sk_atomic_inc

GrScratchKey::ResourceType GrScratchKey::GenerateResourceType() {
    static int32_t gType = INHERITED::kInvalidDomain + 1;

    int32_t type = sk_atomic_inc(&gType);
    if (type > SkTo<int32_t>(UINT16_MAX)) {
        SK_ABORT("Too many Resource Types");
    }

    return static_cast<ResourceType>(type);
}
开发者ID:jasonLaster,项目名称:gecko-dev,代码行数:10,代码来源:GrResourceCache.cpp


示例16: SkNextPixelRefGenerationID

int32_t SkNextPixelRefGenerationID() {
    static int32_t  gPixelRefGenerationID;
    // do a loop in case our global wraps around, as we never want to
    // return a 0
    int32_t genID;
    do {
        genID = sk_atomic_inc(&gPixelRefGenerationID) + 1;
    } while (0 == genID);
    return genID;
}
开发者ID:caiyongjian,项目名称:kalpa,代码行数:10,代码来源:SkPixelRef.cpp


示例17: next_generation_id

static int32_t next_generation_id() {
    static int32_t gCanvasDrawableGenerationID;

    // do a loop in case our global wraps around, as we never want to
    // return a 0
    int32_t genID;
    do {
        genID = sk_atomic_inc(&gCanvasDrawableGenerationID) + 1;
    } while (0 == genID);
    return genID;
}
开发者ID:Crawping,项目名称:chromium_extract,代码行数:11,代码来源:SkDrawable.cpp


示例18: FamilyTypeface

    FamilyTypeface(Style style, bool sysFont, FamilyRec* family, bool isFixedPitch)
    : INHERITED(style, sk_atomic_inc(&gUniqueFontID) + 1, isFixedPitch) {
        fIsSysFont = sysFont;

        SkAutoMutexAcquire  ac(gFamilyMutex);

        if (NULL == family) {
            family = SkNEW(FamilyRec);
        }
        family->fFaces[style] = this;
        fFamilyRec = family;    // just record it so we can return it if asked
    }
开发者ID:ConradIrwin,项目名称:gecko-dev,代码行数:12,代码来源:SkFontHost_linux.cpp


示例19: bumpCount

static void bumpCount(skiatest::Reporter* reporter, bool skipping) {
    if (reporter->verbose()) {
        static int threadTestCount;
        sk_atomic_inc(&threadTestCount);
        if (!skipping && threadTestCount % 100 == 0) {
            SkDebugf("#%d\n", threadTestCount);
        }
        if (skipping && threadTestCount % 10000 == 0) {
            SkDebugf("#%d\n", threadTestCount);
        }
    }
}
开发者ID:MIPS,项目名称:external-skia,代码行数:12,代码来源:SkpSkGrTest.cpp


示例20: testSkpClipMain

static void testSkpClipMain(PathOpsThreadState* data) {
        SkString str(data->fSerialNo);
        testOne(str);
        if (data->fReporter->verbose()) {
            SkDebugf(".");
            static int threadTestCount;
            sk_atomic_inc(&threadTestCount);
            if (threadTestCount % 100 == 0) {
                SkDebugf("\n");
            }
        }
}
开发者ID:andreicoman11,项目名称:OsmAnd-external-skia,代码行数:12,代码来源:PathOpsSkpClipTest.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ sk_bzero函数代码示例发布时间:2022-05-30
下一篇:
C++ sk_atm函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap