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 16 #ifndef GRAPHICS_EFFECT_WAVY_RIPPLE_LIGHT_SHADER_H 17 #define GRAPHICS_EFFECT_WAVY_RIPPLE_LIGHT_SHADER_H 18 19 #include "ge_shader.h" 20 #include "ge_shader_filter_params.h" 21 #include "common/rs_vector2.h" 22 #include "effect/runtime_shader_builder.h" 23 #include "utils/matrix.h" 24 25 namespace OHOS { 26 namespace Rosen { 27 28 class GE_EXPORT GEWavyRippleLightShader : public GEShader { 29 30 public: 31 GEWavyRippleLightShader(); 32 GEWavyRippleLightShader(Drawing::GEWavyRippleLightShaderParams& wavyRippleLightParams); 33 ~GEWavyRippleLightShader() override = default; 34 void MakeDrawingShader(const Drawing::Rect& rect, float progress) override; GetDescription()35 const std::string GetDescription() const { return "GEWavyRippleLightShader"; } SetWavyRippleLightParams(const Drawing::GEWavyRippleLightShaderParams & params)36 void SetWavyRippleLightParams(const Drawing::GEWavyRippleLightShaderParams& params) 37 { 38 wavyRippleLightParams_ = params; 39 } 40 std::shared_ptr<Drawing::ShaderEffect> MakeWavyRippleLightShader(const Drawing::Rect& rect); 41 static std::shared_ptr<GEWavyRippleLightShader> CreateWavyRippleLightShader( 42 Drawing::GEWavyRippleLightShaderParams& param); 43 std::shared_ptr<Drawing::RuntimeShaderBuilder> GetWavyRippleLightBuilder(); 44 45 private: 46 GEWavyRippleLightShader(const GEWavyRippleLightShader&) = delete; 47 GEWavyRippleLightShader(const GEWavyRippleLightShader&&) = delete; 48 GEWavyRippleLightShader& operator=(const GEWavyRippleLightShader&) = delete; 49 GEWavyRippleLightShader& operator=(const GEWavyRippleLightShader&&) = delete; 50 51 Drawing::GEWavyRippleLightShaderParams wavyRippleLightParams_; 52 std::shared_ptr<Drawing::RuntimeShaderBuilder> builder_; 53 }; 54 55 } // namespace Rosen 56 } // namespace OHOS 57 #endif // GRAPHICS_EFFECT_EXT_DOT_MATRIX_SHADER_H