/src/skia/src/sksl/ir/SkSLVariable.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright 2021 Google LLC. |
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 | | #include "src/sksl/ir/SkSLVariable.h" |
9 | | |
10 | | #include "src/sksl/ir/SkSLVarDeclarations.h" |
11 | | |
12 | | namespace SkSL { |
13 | | |
14 | 21.6M | Variable::~Variable() { |
15 | | // Unhook this Variable from its associated VarDeclaration, since we're being deleted. |
16 | 21.6M | if (fDeclaration) { |
17 | 765k | fDeclaration->setVar(nullptr); |
18 | 765k | } |
19 | 21.6M | } |
20 | | |
21 | 53.7k | const Expression* Variable::initialValue() const { |
22 | 53.7k | return fDeclaration ? fDeclaration->value().get() : nullptr; |
23 | 53.7k | } |
24 | | |
25 | | } // namespace SkSL |