• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2017 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 #include "SkSLSetting.h"
9 #include "SkSLIRGenerator.h"
10 #include "SkSLVariableReference.h"
11 
12 namespace SkSL {
13 
constantPropagate(const IRGenerator & irGenerator,const DefinitionMap & definitions)14 std::unique_ptr<Expression> Setting::constantPropagate(const IRGenerator& irGenerator,
15                                                        const DefinitionMap& definitions) {
16     if (irGenerator.fSettings->fReplaceSettings) {
17         return VariableReference::copy_constant(irGenerator, fValue.get());
18     }
19     return nullptr;
20 }
21 
22 } // namespace
23