OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "gm.h" | 8 #include "gm.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkGradientShader.h" | 10 #include "SkGradientShader.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 SK_ARRAY_COUNT(g1Colors), | 91 SK_ARRAY_COUNT(g1Colors), |
92 SkShader::kClamp_TileMode)); | 92 SkShader::kClamp_TileMode)); |
93 fGr2.reset(SkGradientShader::CreateLinear(g2Points, | 93 fGr2.reset(SkGradientShader::CreateLinear(g2Points, |
94 g2Colors, | 94 g2Colors, |
95 pos, | 95 pos, |
96 SK_ARRAY_COUNT(g2Colors), | 96 SK_ARRAY_COUNT(g2Colors), |
97 SkShader::kClamp_TileMode)); | 97 SkShader::kClamp_TileMode)); |
98 } | 98 } |
99 | 99 |
100 protected: | 100 protected: |
101 virtual uint32_t onGetFlags() const SK_OVERRIDE { | 101 uint32_t onGetFlags() const SK_OVERRIDE { |
102 return kSkipTiled_Flag; | 102 return kSkipTiled_Flag; |
103 } | 103 } |
104 | 104 |
105 virtual SkString onShortName() SK_OVERRIDE { | 105 SkString onShortName() SK_OVERRIDE { |
106 return SkString("lumafilter"); | 106 return SkString("lumafilter"); |
107 } | 107 } |
108 | 108 |
109 virtual SkISize onISize() SK_OVERRIDE { | 109 SkISize onISize() SK_OVERRIDE { |
110 return SkISize::Make(600, 420); | 110 return SkISize::Make(600, 420); |
111 } | 111 } |
112 | 112 |
113 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 113 void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
114 SkXfermode::Mode modes[] = { SkXfermode::kSrcOver_Mode, | 114 SkXfermode::Mode modes[] = { SkXfermode::kSrcOver_Mode, |
115 SkXfermode::kDstOver_Mode, | 115 SkXfermode::kDstOver_Mode, |
116 SkXfermode::kSrcATop_Mode, | 116 SkXfermode::kSrcATop_Mode, |
117 SkXfermode::kDstATop_Mode, | 117 SkXfermode::kDstATop_Mode, |
118 SkXfermode::kSrcIn_Mode, | 118 SkXfermode::kSrcIn_Mode, |
119 SkXfermode::kDstIn_Mode, | 119 SkXfermode::kDstIn_Mode, |
120 }; | 120 }; |
121 struct { | 121 struct { |
122 SkShader* fShader1; | 122 SkShader* fShader1; |
123 SkShader* fShader2; | 123 SkShader* fShader2; |
(...skipping 25 matching lines...) Expand all Loading... |
149 private: | 149 private: |
150 SkAutoTUnref<SkColorFilter> fFilter; | 150 SkAutoTUnref<SkColorFilter> fFilter; |
151 SkAutoTUnref<SkShader> fGr1, fGr2; | 151 SkAutoTUnref<SkShader> fGr1, fGr2; |
152 | 152 |
153 typedef skiagm::GM INHERITED; | 153 typedef skiagm::GM INHERITED; |
154 }; | 154 }; |
155 | 155 |
156 ////////////////////////////////////////////////////////////////////////////// | 156 ////////////////////////////////////////////////////////////////////////////// |
157 | 157 |
158 DEF_GM( return SkNEW(LumaFilterGM); ) | 158 DEF_GM( return SkNEW(LumaFilterGM); ) |
OLD | NEW |