Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
SkSLDefines.h
Go to the documentation of this file.
1/*
2 * Copyright 2019 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef SKSL_DEFINES
9#define SKSL_DEFINES
10
11#include <cstdint>
12
15
16using SKSL_INT = int64_t;
17using SKSL_FLOAT = float;
18
19namespace SkSL {
20
21class Expression;
22class Statement;
23
25
26class ExpressionArray : public skia_private::STArray<2, std::unique_ptr<Expression>> {
27public:
28 using STArray::STArray;
29
30 /** Returns a new ExpressionArray containing a clone of every element. */
31 ExpressionArray clone() const;
32};
33
35
36// Functions larger than this (measured in IR nodes) will not be inlined. This growth factor
37// accounts for the number of calls being inlined--i.e., a function called five times (that is, with
38// five inlining opportunities) would be considered 5x larger than if it were called once. This
39// default threshold value is arbitrary, but tends to work well in practice.
40static constexpr int kDefaultInlineThreshold = 50;
41
42// A hard upper limit on the number of variable slots allowed in a function/global scope.
43// This is an arbitrary limit, but is needed to prevent code generation from taking unbounded
44// amounts of time or space.
45static constexpr int kVariableSlotLimit = 100000;
46
47} // namespace SkSL
48
49#endif
int64_t SKSL_INT
Definition SkSLDefines.h:16
float SKSL_FLOAT
Definition SkSLDefines.h:17
ExpressionArray clone() const
static constexpr int kDefaultInlineThreshold
Definition SkSLDefines.h:40
static constexpr int kVariableSlotLimit
Definition SkSLDefines.h:45