Flutter Engine
The Flutter Engine
Classes | Typedefs | Functions | Variables
skia_private Namespace Reference

Classes

class  AutoSTArray
 
class  AutoSTMalloc
 
class  AutoTArray
 
class  AutoTMalloc
 
class  FixedArray
 
class  ScopedTracer
 
class  STArray
 
class  TArray
 
class  THashMap
 
class  THashSet
 
class  THashTable
 
class  TraceID
 
class  TraceStringWithCopy
 

Typedefs

using UniqueVoidPtr = std::unique_ptr< void, SkOverloadedFunctionObject< void(void *), sk_free > >
 

Functions

template<typename T , bool M>
static void swap (TArray< T, M > &a, TArray< T, M > &b)
 
template<typename T >
static void SetTraceValue (const T &arg, unsigned char *type, uint64_t *value)
 
static const char * TraceValueAsString (uint64_t value)
 
static const void * TraceValueAsPointer (uint64_t value)
 
static SkEventTracer::Handle AddTraceEvent (char phase, const uint8_t *category_group_enabled, const char *name, uint64_t id, unsigned char flags)
 
template<class ARG1_TYPE >
static SkEventTracer::Handle AddTraceEvent (char phase, const uint8_t *category_group_enabled, const char *name, uint64_t id, unsigned char flags, const char *arg1_name, const ARG1_TYPE &arg1_val)
 
template<class ARG1_TYPE , class ARG2_TYPE >
static SkEventTracer::Handle AddTraceEvent (char phase, const uint8_t *category_group_enabled, const char *name, uint64_t id, unsigned char flags, const char *arg1_name, const ARG1_TYPE &arg1_val, const char *arg2_name, const ARG2_TYPE &arg2_val)
 

Variables

const int kZeroNumArgs = 0
 
const uint64_t kNoEventId = 0
 

Typedef Documentation

◆ UniqueVoidPtr

using skia_private::UniqueVoidPtr = typedef std::unique_ptr<void, SkOverloadedFunctionObject<void(void*), sk_free> >

Definition at line 431 of file SkTemplates.h.

Function Documentation

◆ AddTraceEvent() [1/3]

static SkEventTracer::Handle skia_private::AddTraceEvent ( char  phase,
const uint8_t *  category_group_enabled,
const char *  name,
uint64_t  id,
unsigned char  flags 
)
inlinestatic

Definition at line 310 of file SkTraceEvent.h.

315 {
317 phase, category_group_enabled, name, id,
318 kZeroNumArgs, nullptr, nullptr, nullptr, flags);
319}
#define TRACE_EVENT_API_ADD_TRACE_EVENT
Definition: SkTraceEvent.h:103
FlutterSemanticsFlag flags
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32
const int kZeroNumArgs
Definition: SkTraceEvent.h:214

◆ AddTraceEvent() [2/3]

template<class ARG1_TYPE >
static SkEventTracer::Handle skia_private::AddTraceEvent ( char  phase,
const uint8_t *  category_group_enabled,
const char *  name,
uint64_t  id,
unsigned char  flags,
const char *  arg1_name,
const ARG1_TYPE &  arg1_val 
)
inlinestatic

Definition at line 323 of file SkTraceEvent.h.

330 {
331 const int num_args = 1;
332 uint8_t arg_types[1];
333 uint64_t arg_values[1];
334 SetTraceValue(arg1_val, &arg_types[0], &arg_values[0]);
336 phase, category_group_enabled, name, id,
337 num_args, &arg1_name, arg_types, arg_values, flags);
338}
static void SetTraceValue(const T &arg, unsigned char *type, uint64_t *value)
Definition: SkTraceEvent.h:264

◆ AddTraceEvent() [3/3]

template<class ARG1_TYPE , class ARG2_TYPE >
static SkEventTracer::Handle skia_private::AddTraceEvent ( char  phase,
const uint8_t *  category_group_enabled,
const char *  name,
uint64_t  id,
unsigned char  flags,
const char *  arg1_name,
const ARG1_TYPE &  arg1_val,
const char *  arg2_name,
const ARG2_TYPE &  arg2_val 
)
inlinestatic

Definition at line 342 of file SkTraceEvent.h.

351 {
352 const int num_args = 2;
353 const char* arg_names[2] = { arg1_name, arg2_name };
354 unsigned char arg_types[2];
355 uint64_t arg_values[2];
356 SetTraceValue(arg1_val, &arg_types[0], &arg_values[0]);
357 SetTraceValue(arg2_val, &arg_types[1], &arg_values[1]);
359 phase, category_group_enabled, name, id,
360 num_args, arg_names, arg_types, arg_values, flags);
361}

◆ SetTraceValue()

template<typename T >
static void skia_private::SetTraceValue ( const T arg,
unsigned char *  type,
uint64_t *  value 
)
inlinestatic

Definition at line 264 of file SkTraceEvent.h.

264 {
265 static_assert(sizeof(T) <= sizeof(uint64_t), "Trace value is larger than uint64_t");
266
267 if constexpr (std::is_same<bool, T>::value) {
269 *value = arg;
270 } else if constexpr (std::is_same<const char*, T>::value) {
272 *value = reinterpret_cast<uintptr_t>(arg);
273 } else if constexpr (std::is_same<TraceStringWithCopy, T>::value) {
275 *value = reinterpret_cast<uintptr_t>(static_cast<const char*>(arg));
276 } else if constexpr (std::is_pointer<T>::value) {
278 *value = reinterpret_cast<uintptr_t>(arg);
279 } else if constexpr (std::is_unsigned_v<T>) {
281 *value = arg;
282 } else if constexpr (std::is_signed_v<T>) {
284 *value = static_cast<uint64_t>(arg);
285 } else if constexpr (std::is_floating_point_v<T>) {
287 *value = sk_bit_cast<uint64_t>(arg);
288 } else {
289 // This is really an assert(false), but if it doesn't reference T, the static_assert fails
290 // before the template is instantiated.
291 static_assert(!sizeof(T), "Unsupported type for trace argument");
292 }
293}
#define TRACE_VALUE_TYPE_STRING
#define TRACE_VALUE_TYPE_BOOL
#define TRACE_VALUE_TYPE_POINTER
#define TRACE_VALUE_TYPE_COPY_STRING
#define TRACE_VALUE_TYPE_INT
#define TRACE_VALUE_TYPE_UINT
#define TRACE_VALUE_TYPE_DOUBLE
GLenum type
uint8_t value
#define T
Definition: precompiler.cc:65

◆ swap()

template<typename T , bool M>
static void skia_private::swap ( TArray< T, M > &  a,
TArray< T, M > &  b 
)
inlinestatic

Definition at line 747 of file SkTArray.h.

747 {
748 a.swap(b);
749}
static bool b
struct MyStruct a[10]

◆ TraceValueAsPointer()

static const void * skia_private::TraceValueAsPointer ( uint64_t  value)
inlinestatic

Definition at line 300 of file SkTraceEvent.h.

300 {
301 return reinterpret_cast<const void*>(static_cast<uintptr_t>(value));
302}

◆ TraceValueAsString()

static const char * skia_private::TraceValueAsString ( uint64_t  value)
inlinestatic

Definition at line 296 of file SkTraceEvent.h.

296 {
297 return reinterpret_cast<const char*>(static_cast<uintptr_t>(value));
298}

Variable Documentation

◆ kNoEventId

const uint64_t skia_private::kNoEventId = 0

Definition at line 215 of file SkTraceEvent.h.

◆ kZeroNumArgs

const int skia_private::kZeroNumArgs = 0

Definition at line 214 of file SkTraceEvent.h.