1 /* 2 * Copyright (c) 2024 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 BLUROP_DEFINED 17 #define BLUROP_DEFINED 18 19 #include "include/core/SkBlurTypes.h" 20 #include "include/gpu/GrBackendSurface.h" 21 #include "include/gpu/GrTypes.h" 22 #include "src/gpu/ops/GrOp.h" 23 24 class GrOpFlushState; 25 class GrRecordingContext; 26 27 namespace skgpu::v1 { 28 29 class BlurOp final : public GrOp { 30 public: 31 DEFINE_OP_CLASS_ID 32 name()33 const char* name() const override { return "Blur"; } 34 35 private: 36 friend class GrOp; // for ctors 37 38 BlurOp(GrSurfaceProxyView proxyView, const SkBlurArg& blurArg); 39 40 CombineResult onCombineIfPossible(GrOp* t, SkArenaAlloc*, const GrCaps& caps) override; 41 onPrePrepare(GrRecordingContext *,const GrSurfaceProxyView & writeView,GrAppliedClip *,const GrDstProxyView &,GrXferBarrierFlags renderPassXferBarriers,GrLoadOp colorLoadOp)42 void onPrePrepare(GrRecordingContext*, const GrSurfaceProxyView& writeView, GrAppliedClip*, 43 const GrDstProxyView&, GrXferBarrierFlags renderPassXferBarriers, 44 GrLoadOp colorLoadOp) override {} 45 onPrepare(GrOpFlushState *)46 void onPrepare(GrOpFlushState*) override {} 47 48 void onExecute(GrOpFlushState* state, const SkRect& chainBounds) override; 49 50 GrSurfaceProxyView fProxyView; 51 SkBlurArg skBlurArg; 52 }; 53 54 } // namespace skgpu::v1 55 56 #endif // BLUROP_DEFINED 57