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 "sk_tool_utils.h" | 9 #include "sk_tool_utils.h" |
10 #include "SkArithmeticMode.h" | 10 #include "SkArithmeticMode.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 void onOnceBeforeDraw() override { | 68 void onOnceBeforeDraw() override { |
69 make_bitmap(); | 69 make_bitmap(); |
70 | 70 |
71 fCheckerboard.allocN32Pixels(80, 80); | 71 fCheckerboard.allocN32Pixels(80, 80); |
72 SkCanvas checkerboardCanvas(fCheckerboard); | 72 SkCanvas checkerboardCanvas(fCheckerboard); |
73 sk_tool_utils::draw_checkerboard(&checkerboardCanvas, 0xFFA0A0A0, 0xFF40
4040, 8); | 73 sk_tool_utils::draw_checkerboard(&checkerboardCanvas, 0xFFA0A0A0, 0xFF40
4040, 8); |
74 } | 74 } |
75 | 75 |
76 void onDraw(SkCanvas* canvas) override { | 76 void onDraw(SkCanvas* canvas) override { |
77 canvas->clear(0x00000000); | 77 canvas->clear(SK_ColorBLACK); |
78 SkPaint paint; | 78 SkPaint paint; |
79 | 79 |
80 const struct { | 80 const struct { |
81 SkXfermode::Mode fMode; | 81 SkXfermode::Mode fMode; |
82 const char* fLabel; | 82 const char* fLabel; |
83 } gModes[] = { | 83 } gModes[] = { |
84 { SkXfermode::kClear_Mode, "Clear" }, | 84 { SkXfermode::kClear_Mode, "Clear" }, |
85 { SkXfermode::kSrc_Mode, "Src" }, | 85 { SkXfermode::kSrc_Mode, "Src" }, |
86 { SkXfermode::kDst_Mode, "Dst" }, | 86 { SkXfermode::kDst_Mode, "Dst" }, |
87 { SkXfermode::kSrcOver_Mode, "SrcOver" }, | 87 { SkXfermode::kSrcOver_Mode, "SrcOver" }, |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 private: | 201 private: |
202 SkBitmap fBitmap, fCheckerboard; | 202 SkBitmap fBitmap, fCheckerboard; |
203 typedef GM INHERITED; | 203 typedef GM INHERITED; |
204 }; | 204 }; |
205 | 205 |
206 ////////////////////////////////////////////////////////////////////////////// | 206 ////////////////////////////////////////////////////////////////////////////// |
207 | 207 |
208 DEF_GM( return new XfermodeImageFilterGM; ); | 208 DEF_GM( return new XfermodeImageFilterGM; ); |
209 | 209 |
210 } | 210 } |
OLD | NEW |