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/gpu/graphite/GraphicsPipeline.h" 9 #include "src/utils/SkShaderUtils.h" 10 11 namespace skgpu::graphite { 12 GraphicsPipeline(const SharedContext * sharedContext,PipelineInfo * pipelineInfo)13GraphicsPipeline::GraphicsPipeline(const SharedContext* sharedContext, PipelineInfo* pipelineInfo) 14 : Resource(sharedContext, 15 Ownership::kOwned, 16 skgpu::Budgeted::kYes, 17 /*gpuMemorySize=*/0) { 18 #if defined(GRAPHITE_TEST_UTILS) 19 if (pipelineInfo) { 20 fPipelineInfo.fRenderStepID = pipelineInfo->fRenderStepID; 21 fPipelineInfo.fPaintID = pipelineInfo->fPaintID; 22 fPipelineInfo.fSkSLVertexShader = 23 SkShaderUtils::PrettyPrint(pipelineInfo->fSkSLVertexShader); 24 fPipelineInfo.fSkSLFragmentShader = 25 SkShaderUtils::PrettyPrint(pipelineInfo->fSkSLFragmentShader); 26 fPipelineInfo.fNativeVertexShader = std::move(pipelineInfo->fNativeVertexShader); 27 fPipelineInfo.fNativeFragmentShader = std::move(pipelineInfo->fNativeFragmentShader); 28 } 29 #endif 30 } 31 32 GraphicsPipeline::~GraphicsPipeline() = default; 33 34 } // namespace skgpu::graphite 35