首页 > 其他分享 >skia ID产生器

skia ID产生器

时间:2023-02-23 17:22:53浏览次数:30  
标签:id ImageID static 产生器 skia ID include uint32

#include "include/core/SkTypes.h"

class SkNextID {
public:
    /**
     *  Shared between SkPixelRef's generationID and SkImage's uniqueID
     */
    static uint32_t ImageID();
};

/////////////////////////////////////////////////////////////////

#include <atomic>

uint32_t SkNextID::ImageID() {
    // We never set the low bit.... see SkPixelRef::genIDIsUnique().
    static std::atomic<uint32_t> nextID{2};

    uint32_t id;
    do {
        id = nextID.fetch_add(2, std::memory_order_relaxed);
    } while (id == 0);
    return id;
}

 

标签:id,ImageID,static,产生器,skia,ID,include,uint32
From: https://www.cnblogs.com/bigben0123/p/17148825.html

相关文章

  • Mongodb报错:SyntaxError: identifier starts immediately after numeric literal
    我在练习mongodb命令的时候,这段怎么也无法通过,一直报错:SyntaxError:identifierstartsimmediatelyafternumericliteraldb.mycol.insertMany([{_id:ObjectId(7df78a......
  • 测试公开课资料系列01--Fiddler之AutoResponse在线调试利器
     前言做的技艺来自做的过程。明天晚上,笔者在腾讯课堂开播一堂Fiddler实战公开课,嗯~先预先筹备一些课堂资料给大家来分享一、Fiddler在线调试介绍Fiddler在线调试-->Fid......
  • 修改安卓ID为硬件唯一ID
    前言:最近接到个需求,我们新产品上的外包侧APP需要使用硬件唯一ID(不管怎么升级怎么操作,ID始终不变和硬件绑定),用来做权限校验。由于了解到安卓ID或序列号都会在擦除升级后......
  • [Typescript] OVerride external library Types
    import{getAnimatingState}from"fake-animation-lib";import{Equal,Expect}from"../helpers/type-utils";constanimatingState=getAnimatingState();ty......
  • PyQt6 / PySide6
    PrerequisiteQt是C++写的图形界面工具,PyQt和PySide都是Qt的儿子PyQt5和PyQt6,一家私人公司开发的,用它开发商用软件要给这家公司交钱,不交钱就吃官司(PyQt6版本是......
  • Android----->多线程的实现Thread、IntentService的运用
       首先建立一个Intent.xml <?xmlversion="1.0"encoding="utf-8"?><LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"......
  • 我有一壶酒 Android学习之Service(1)--->BinderService方式
      本文只讨论扩展Binder类   创建一个Binder.xml<?xmlversion="1.0"encoding="utf-8"?><LinearLayoutxmlns:android="http://schemas.and......
  • Android学习之Service(1)--->Started方式
     界面退出后进程程序还在运行,不会被杀死,如音乐播发器、后台下载等  注:本文只讨论Started方式    main.xml代码分析<?xmlversion="1.......
  • CSS Id 和 Class
    id和class选择器如果你要在HTML元素中设置CSS样式,你需要在元素中设置"id"和"class"选择器。id选择器id选择器可以为标有特定id的HTML元素指定特定的样式。......
  • Android AIDL interface for HALs
    已有的一个AIDLinterface== /hardware/interfaces/health/aidl/android/hardware/health/IHealth.aidl随便添加一个function到AIDLfile1.直接mm编译==>提示AI......