OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 | 154 |
155 static const int gXSize = 4096; | 155 static const int gXSize = 4096; |
156 static const int gYSize = 4096; | 156 static const int gYSize = 4096; |
157 static const int gBorderWidth = 10; | 157 static const int gBorderWidth = 10; |
158 | 158 |
159 bitmap->allocN32Pixels(gXSize, gYSize); | 159 bitmap->allocN32Pixels(gXSize, gYSize); |
160 for (int y = 0; y < gYSize; ++y) { | 160 for (int y = 0; y < gYSize; ++y) { |
161 for (int x = 0; x < gXSize; ++x) { | 161 for (int x = 0; x < gXSize; ++x) { |
162 if (x <= gBorderWidth || x >= gXSize-gBorderWidth || | 162 if (x <= gBorderWidth || x >= gXSize-gBorderWidth || |
163 y <= gBorderWidth || y >= gYSize-gBorderWidth) { | 163 y <= gBorderWidth || y >= gYSize-gBorderWidth) { |
164 *bitmap->getAddr32(x, y) = 0x88FFFFFF; | 164 *bitmap->getAddr32(x, y) = SkPreMultiplyColor(0x88FFFFFF); |
165 } else { | 165 } else { |
166 *bitmap->getAddr32(x, y) = 0x88FF0000; | 166 *bitmap->getAddr32(x, y) = SkPreMultiplyColor(0x88FF0000); |
167 } | 167 } |
168 } | 168 } |
169 } | 169 } |
170 } | 170 } |
171 | 171 |
172 // This GM attempts to reveal any issues we may have when the GPU has to | 172 // This GM attempts to reveal any issues we may have when the GPU has to |
173 // break up a large texture in order to draw it. The XOR transfer mode will | 173 // break up a large texture in order to draw it. The XOR transfer mode will |
174 // create stripes in the image if there is imprecision in the destination | 174 // create stripes in the image if there is imprecision in the destination |
175 // tile placement. | 175 // tile placement. |
176 class DrawBitmapRect4 : public skiagm::GM { | 176 class DrawBitmapRect4 : public skiagm::GM { |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 static skiagm::GMRegistry reg0(MyFactory0); | 288 static skiagm::GMRegistry reg0(MyFactory0); |
289 static skiagm::GMRegistry reg1(MyFactory1); | 289 static skiagm::GMRegistry reg1(MyFactory1); |
290 | 290 |
291 static skiagm::GMRegistry reg2(MyFactory2); | 291 static skiagm::GMRegistry reg2(MyFactory2); |
292 | 292 |
293 #ifndef SK_BUILD_FOR_ANDROID | 293 #ifndef SK_BUILD_FOR_ANDROID |
294 static skiagm::GMRegistry reg3(MyFactory3); | 294 static skiagm::GMRegistry reg3(MyFactory3); |
295 static skiagm::GMRegistry reg4(MyFactory4); | 295 static skiagm::GMRegistry reg4(MyFactory4); |
296 #endif | 296 #endif |
297 | 297 |
OLD | NEW |