| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 virtual SkString onShortName() { | 75 virtual SkString onShortName() { |
| 76 return SkString("arithmode"); | 76 return SkString("arithmode"); |
| 77 } | 77 } |
| 78 | 78 |
| 79 virtual SkISize onISize() { return SkISize::Make(640, 572); } | 79 virtual SkISize onISize() { return SkISize::Make(640, 572); } |
| 80 | 80 |
| 81 virtual void onDraw(SkCanvas* canvas) { | 81 virtual void onDraw(SkCanvas* canvas) { |
| 82 SkBitmap src = make_src(); | 82 SkBitmap src = make_src(); |
| 83 SkBitmap dst = make_dst(); | 83 SkBitmap dst = make_dst(); |
| 84 | 84 |
| 85 const SkScalar one = SK_Scalar1; | 85 constexpr SkScalar one = SK_Scalar1; |
| 86 static const SkScalar K[] = { | 86 constexpr SkScalar K[] = { |
| 87 0, 0, 0, 0, | 87 0, 0, 0, 0, |
| 88 0, 0, 0, one, | 88 0, 0, 0, one, |
| 89 0, one, 0, 0, | 89 0, one, 0, 0, |
| 90 0, 0, one, 0, | 90 0, 0, one, 0, |
| 91 0, one, one, 0, | 91 0, one, one, 0, |
| 92 0, one, -one, 0, | 92 0, one, -one, 0, |
| 93 0, one/2, one/2, 0, | 93 0, one/2, one/2, 0, |
| 94 0, one/2, one/2, one/4, | 94 0, one/2, one/2, one/4, |
| 95 0, one/2, one/2, -one/4, | 95 0, one/2, one/2, -one/4, |
| 96 one/4, one/2, one/2, 0, | 96 one/4, one/2, one/2, 0, |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 } | 153 } |
| 154 } | 154 } |
| 155 | 155 |
| 156 private: | 156 private: |
| 157 typedef GM INHERITED; | 157 typedef GM INHERITED; |
| 158 }; | 158 }; |
| 159 | 159 |
| 160 /////////////////////////////////////////////////////////////////////////////// | 160 /////////////////////////////////////////////////////////////////////////////// |
| 161 | 161 |
| 162 DEF_GM( return new ArithmodeGM; ) | 162 DEF_GM( return new ArithmodeGM; ) |
| OLD | NEW |