Flutter Engine
The Flutter Engine
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;
18
19namespace SkSL {
20
21class Expression;
22class Statement;
23
24class ExpressionArray : public skia_private::STArray<2, std::unique_ptr<Expression>> {
25public:
26 using STArray::STArray;
27
28 /** Returns a new ExpressionArray containing a clone of every element. */
29 ExpressionArray clone() const;
30};
31
33
34// Functions larger than this (measured in IR nodes) will not be inlined. This growth factor
35// accounts for the number of calls being inlined--i.e., a function called five times (that is, with
36// five inlining opportunities) would be considered 5x larger than if it were called once. This
37// default threshold value is arbitrary, but tends to work well in practice.
38static constexpr int kDefaultInlineThreshold = 50;
39
40// A hard upper limit on the number of variable slots allowed in a function/global scope.
41// This is an arbitrary limit, but is needed to prevent code generation from taking unbounded
42// amounts of time or space.
43static constexpr int kVariableSlotLimit = 100000;
44
45} // namespace SkSL
46
47#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:38
static constexpr int kVariableSlotLimit
Definition: SkSLDefines.h:43