1 /* 2 * Copyright 2022 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 "include/core/SkCapabilities.h" 9 10 #ifdef SK_ENABLE_SKSL 11 #include "src/sksl/SkSLUtil.h" 12 #endif 13 RasterBackend()14sk_sp<const SkCapabilities> SkCapabilities::RasterBackend() { 15 static SkCapabilities* sCaps = [](){ 16 SkCapabilities* caps = new SkCapabilities; 17 #ifdef SK_ENABLE_SKSL 18 caps->fSkSLVersion = SkSL::Version::k100; 19 #endif 20 return caps; 21 }(); 22 23 return sk_ref_sp(sCaps); 24 } 25 26 #ifdef SK_ENABLE_SKSL initSkCaps(const SkSL::ShaderCaps * shaderCaps)27void SkCapabilities::initSkCaps(const SkSL::ShaderCaps* shaderCaps) { 28 this->fSkSLVersion = shaderCaps->supportedSkSLVerion(); 29 } 30 #endif 31