1 /* 2 * Copyright (c) 2025 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 #ifndef GRAPHICS_EFFECT_BORDER_LIGHT_SHADER_H 16 #define GRAPHICS_EFFECT_BORDER_LIGHT_SHADER_H 17 18 #include "ge_shader.h" 19 #include "common/rs_vector3.h" 20 #include "common/rs_vector4.h" 21 #include "effect/runtime_shader_builder.h" 22 #include "utils/matrix.h" 23 #include "ge_shader_filter_params.h" 24 25 namespace OHOS { 26 namespace Rosen { 27 28 class GE_EXPORT GEBorderLightShader : public GEShader { 29 public: 30 GEBorderLightShader(); 31 GEBorderLightShader(Drawing::GEBorderLightShaderParams& borderLightParams); 32 33 ~GEBorderLightShader() override = default; 34 35 void MakeDrawingShader(const Drawing::Rect& rect, float progress) override; 36 GetDescription()37 const std::string GetDescription() const { return "GEBorderLightShader"; } 38 SetBorderLightParams(const Drawing::GEBorderLightShaderParams & params)39 void SetBorderLightParams(const Drawing::GEBorderLightShaderParams& params) 40 { 41 borderLightParams_ = params; 42 } 43 44 std::shared_ptr<Drawing::ShaderEffect> MakeBorderLightShader(const Drawing::Rect& rect); 45 46 std::shared_ptr<Drawing::RuntimeShaderBuilder> GetBorderLightBuilder(); 47 private: 48 GEBorderLightShader(const GEBorderLightShader&) = delete; 49 GEBorderLightShader(const GEBorderLightShader&&) = delete; 50 GEBorderLightShader& operator=(const GEBorderLightShader&) = delete; 51 GEBorderLightShader& operator=(const GEBorderLightShader&&) = delete; 52 53 Drawing::GEBorderLightShaderParams borderLightParams_; 54 std::shared_ptr<Drawing::RuntimeShaderBuilder> builder_; 55 }; 56 57 } // namespace Rosen 58 } // namespace OHOS 59 #endif // GRAPHICS_EFFECT_EXT_DOT_MATRIX_SHADER_H