blob: 2d4a8ba151b662de83ce33f0c2cbc485d1c587f1 [file] [log] [blame]
Ethan Nicholasc0709392017-06-27 11:20:22 -04001/*
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
12namespace SkSL {
13
14std::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} // namespace
22