• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2014 Google Inc.
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 #ifndef SkBlurTypes_DEFINED
9 #define SkBlurTypes_DEFINED
10 
11 #include "include/core/SkRect.h"
12 #include "include/core/SkScalar.h"
13 #include "include/core/SkTypes.h"
14 #include "include/gpu/GrTypes.h"
15 
16 enum SkBlurStyle : int {
17     kNormal_SkBlurStyle,  //!< fuzzy inside and outside
18     kSolid_SkBlurStyle,   //!< solid inside, fuzzy outside
19     kOuter_SkBlurStyle,   //!< nothing inside, fuzzy outside
20     kInner_SkBlurStyle,   //!< fuzzy inside, nothing outside
21 
22     kLastEnum_SkBlurStyle = kInner_SkBlurStyle,
23 };
24 
25 //for huawei hps blur
26 typedef struct SkOriginInfo {
27     GrSurfaceOrigin imageOrigin;
28     GrSurfaceOrigin rtOrigin;
29 } SkOriginInfo;
30 
31 //for huawei hps blur
32 struct SkBlurArg {
33     SkRect srcRect;
34     SkRect dstRect;
35     SkScalar sigma { 1E-6 };
36     float saturation { 1.0 };
37     float brightness { 1.0 };
SkBlurArgSkBlurArg38     SkBlurArg(const SkRect& srcRect, const SkRect& dstRect, const SkScalar& sigma,
39         float saturation, float brightness)
40     {
41         this->srcRect = srcRect;
42         this->dstRect = dstRect;
43         this->sigma = sigma;
44         this->saturation = saturation;
45         this->brightness = brightness;
46     }
47 };
48 
49 #endif
50