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 "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkShader.h" | 10 #include "SkShader.h" |
11 #include "SkXfermode.h" | 11 #include "SkXfermode.h" |
12 | 12 |
13 namespace skiagm { | 13 namespace skiagm { |
14 | 14 |
15 static void make_bitmaps(int w, int h, SkBitmap* src, SkBitmap* dst, | 15 static void make_bitmaps(int w, int h, SkBitmap* src, SkBitmap* dst, |
16 SkBitmap* transparent) { | 16 SkBitmap* transparent) { |
17 src->setConfig(SkBitmap::kARGB_8888_Config, w, h); | 17 src->allocN32Pixels(w, h); |
18 src->allocPixels(); | |
19 src->eraseColor(SK_ColorTRANSPARENT); | 18 src->eraseColor(SK_ColorTRANSPARENT); |
20 | 19 |
21 SkPaint p; | 20 SkPaint p; |
22 p.setAntiAlias(true); | 21 p.setAntiAlias(true); |
23 | 22 |
24 SkRect r; | 23 SkRect r; |
25 SkScalar ww = SkIntToScalar(w); | 24 SkScalar ww = SkIntToScalar(w); |
26 SkScalar hh = SkIntToScalar(h); | 25 SkScalar hh = SkIntToScalar(h); |
27 | 26 |
28 { | 27 { |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 private: | 284 private: |
286 typedef GM INHERITED; | 285 typedef GM INHERITED; |
287 }; | 286 }; |
288 | 287 |
289 ////////////////////////////////////////////////////////////////////////////// | 288 ////////////////////////////////////////////////////////////////////////////// |
290 | 289 |
291 static GM* MyFactory(void*) { return new XfermodesGM; } | 290 static GM* MyFactory(void*) { return new XfermodesGM; } |
292 static GMRegistry reg(MyFactory); | 291 static GMRegistry reg(MyFactory); |
293 | 292 |
294 } | 293 } |
OLD | NEW |