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 | 9 |
10 #include "Resources.h" | 10 #include "Resources.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 y_offset += textYOffset[y]; | 93 y_offset += textYOffset[y]; |
94 } | 94 } |
95 | 95 |
96 // draw with shaders and image filters | 96 // draw with shaders and image filters |
97 for (int i = 0; i < 2; i++) { | 97 for (int i = 0; i < 2; i++) { |
98 for (int j = 0; j < 2; j++) { | 98 for (int j = 0; j < 2; j++) { |
99 for (int k = 0; k < 2; k++) { | 99 for (int k = 0; k < 2; k++) { |
100 SkPaint shaderPaint; | 100 SkPaint shaderPaint; |
101 shaderPaint.setTypeface(fTypeface); | 101 shaderPaint.setTypeface(fTypeface); |
102 if (SkToBool(i)) { | 102 if (SkToBool(i)) { |
103 shaderPaint.setShader(MakeLinear()); | 103 shaderPaint.setShader(MakeLinear())->unref(); |
104 } | 104 } |
105 | 105 |
106 if (SkToBool(j) && SkToBool(k)) { | 106 if (SkToBool(j) && SkToBool(k)) { |
107 SkAutoTUnref<SkImageFilter> grayScale(make_grayscale(NUL
L)); | 107 SkAutoTUnref<SkImageFilter> grayScale(make_grayscale(NUL
L)); |
108 SkAutoTUnref<SkImageFilter> blur(make_blur(3.0f, graySca
le)); | 108 SkAutoTUnref<SkImageFilter> blur(make_blur(3.0f, graySca
le)); |
109 shaderPaint.setImageFilter(blur); | 109 shaderPaint.setImageFilter(blur); |
110 } else if (SkToBool(j)) { | 110 } else if (SkToBool(j)) { |
111 SkAutoTUnref<SkImageFilter> blur(make_blur(3.0f, NULL)); | 111 SkAutoTUnref<SkImageFilter> blur(make_blur(3.0f, NULL)); |
112 shaderPaint.setImageFilter(blur); | 112 shaderPaint.setImageFilter(blur); |
113 } else if (SkToBool(k)) { | 113 } else if (SkToBool(k)) { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 | 165 |
166 typedef GM INHERITED; | 166 typedef GM INHERITED; |
167 }; | 167 }; |
168 | 168 |
169 ////////////////////////////////////////////////////////////////////////////// | 169 ////////////////////////////////////////////////////////////////////////////// |
170 | 170 |
171 static GM* MyFactory(void*) { return new ColorEmojiGM; } | 171 static GM* MyFactory(void*) { return new ColorEmojiGM; } |
172 static GMRegistry reg(MyFactory); | 172 static GMRegistry reg(MyFactory); |
173 | 173 |
174 } | 174 } |
OLD | NEW |