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 "SampleCode.h" | 8 #include "SampleCode.h" |
9 #include "SkView.h" | 9 #include "SkView.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 size_t rb = bm.rowBytes(); | 67 size_t rb = bm.rowBytes(); |
68 for (int i = 0; i < margin; i++) { | 68 for (int i = 0; i < margin; i++) { |
69 if (!check_zeros(bm.getAddr32(0, i), bm.width(), 1)) { | 69 if (!check_zeros(bm.getAddr32(0, i), bm.width(), 1)) { |
70 return false; | 70 return false; |
71 } | 71 } |
72 int bottom = bm.height() - i - 1; | 72 int bottom = bm.height() - i - 1; |
73 if (!check_zeros(bm.getAddr32(0, bottom), bm.width(), 1)) { | 73 if (!check_zeros(bm.getAddr32(0, bottom), bm.width(), 1)) { |
74 return false; | 74 return false; |
75 } | 75 } |
76 // left column | 76 // left column |
77 if (!check_zeros(bm.getAddr32(i, 0), bm.height(), rb >> 2)) { | 77 if (!check_zeros(bm.getAddr32(i, 0), bm.height(), SkToInt(rb >> 2))) { |
78 return false; | 78 return false; |
79 } | 79 } |
80 int right = bm.width() - margin + i; | 80 int right = bm.width() - margin + i; |
81 if (!check_zeros(bm.getAddr32(right, 0), bm.height(), rb >> 2)) { | 81 if (!check_zeros(bm.getAddr32(right, 0), bm.height(), |
| 82 SkToInt(rb >> 2))) { |
82 return false; | 83 return false; |
83 } | 84 } |
84 } | 85 } |
85 return true; | 86 return true; |
86 } | 87 } |
87 | 88 |
88 #define WIDTH 620 | 89 #define WIDTH 620 |
89 #define HEIGHT 460 | 90 #define HEIGHT 460 |
90 #define MARGIN 10 | 91 #define MARGIN 10 |
91 | 92 |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 | 270 |
270 | 271 |
271 private: | 272 private: |
272 typedef SampleView INHERITED; | 273 typedef SampleView INHERITED; |
273 }; | 274 }; |
274 | 275 |
275 ////////////////////////////////////////////////////////////////////////////// | 276 ////////////////////////////////////////////////////////////////////////////// |
276 | 277 |
277 static SkView* MyFactory() { return new HairlineView; } | 278 static SkView* MyFactory() { return new HairlineView; } |
278 static SkViewRegister reg(MyFactory); | 279 static SkViewRegister reg(MyFactory); |
OLD | NEW |