feat(profile): add region code

This commit is contained in:
phaneron 2024-09-20 00:13:32 -04:00
parent e2b08911e9
commit da8d47619c
21 changed files with 762 additions and 6 deletions

View file

@ -0,0 +1,9 @@
#ifndef STORM_REGION_H
#define STORM_REGION_H
#include "storm/region/found_param.h"
#include "storm/region/rect.h"
#include "storm/region/source.h"
#include "storm/region/region.h"
#endif

View file

@ -0,0 +1,14 @@
#ifndef STORM_REGION_FOUND_PARAM_H
#define STORM_REGION_FOUND_PARAM_H
#include "storm/array.h"
DECLARE_STRUCT(FOUNDPARAM);
struct FOUNDPARAM {
void* param;
int32_t sequence;
};
STORM_TS_GROWABLE_ARRAY(FOUNDPARAM);
#endif

View file

@ -0,0 +1,16 @@
#ifndef STORM_REGION_RECT_H
#define STORM_REGION_RECT_H
#include "storm/array.h"
DECLARE_STRUCT(RECTF);
struct RECTF {
float left;
float bottom;
float right;
float top;
};
STORM_TS_GROWABLE_ARRAY(RECTF);
#endif

View file

@ -0,0 +1,31 @@
#ifndef STORM_REGION_REGION_H
#define STORM_REGION_REGION_H
#include "common/handle.h"
#include "storm/hash.h"
#include "storm/region/source.h"
#include "storm/region/rect.h"
#include "storm/region/found_param.h"
DECLARE_HANDLE(HSRGN);
DECLARE_HANDLE(HLOCKEDRGN);
DECLARE_STRUCT(RGN);
DECLARE_STRUCT(CSRgn);
STORM_TS_HASH(RGN, HASHKEY_NONE);
struct RGN {
TSHashObject_RGN_HASHKEY_NONE b_base;
TSGrowableArray_SOURCE source;
TSGrowableArray_RECTF combined;
TSGrowableArray_FOUNDPARAM foundparams;
RECTF foundparamsrect;
int32_t sequence;
int32_t dirty;
};
struct CSRgn {
HSRGN m_handle;
};
#endif

View file

@ -0,0 +1,17 @@
#ifndef STORM_REGION_SOURCE_H
#define STORM_REGION_SOURCE_H
#include "storm/array.h"
#include "storm/region/rect.h"
DECLARE_STRUCT(SOURCE);
struct SOURCE {
RECTF rect;
void* param;
int32_t sequence;
uint32_t flags;
};
STORM_TS_GROWABLE_ARRAY(SOURCE);
#endif