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 "SampleCode.h" | 8 #include "SampleCode.h" |
9 #include "SkView.h" | 9 #include "SkView.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 drawFadingText(canvas, str, len, x, y, paint); | 116 drawFadingText(canvas, str, len, x, y, paint); |
117 } | 117 } |
118 | 118 |
119 #ifdef SK_BUILD_FOR_WIN | 119 #ifdef SK_BUILD_FOR_WIN |
120 // windows doesn't have roundf | 120 // windows doesn't have roundf |
121 inline float roundf(float x) { return (x-floor(x))>0.5 ? ceil(x) : floor(x); } | 121 inline float roundf(float x) { return (x-floor(x))>0.5 ? ceil(x) : floor(x); } |
122 #endif | 122 #endif |
123 | 123 |
124 #ifdef SK_DEBUG | 124 #ifdef SK_DEBUG |
125 static void make_rgn(SkRegion* rgn, int left, int top, int right, int bottom, | 125 static void make_rgn(SkRegion* rgn, int left, int top, int right, int bottom, |
126 size_t count, int32_t runs[]) { | 126 int count, int32_t runs[]) { |
127 SkIRect r; | 127 SkIRect r; |
128 r.set(left, top, right, bottom); | 128 r.set(left, top, right, bottom); |
129 | 129 |
130 rgn->debugSetRuns(runs, count); | 130 rgn->debugSetRuns(runs, count); |
131 SkASSERT(rgn->getBounds() == r); | 131 SkASSERT(rgn->getBounds() == r); |
132 } | 132 } |
133 | 133 |
134 static void test_union_bug_1505668(SkRegion* ra, SkRegion* rb, SkRegion* rc) { | 134 static void test_union_bug_1505668(SkRegion* ra, SkRegion* rb, SkRegion* rc) { |
135 static int32_t dataA[] = { | 135 static int32_t dataA[] = { |
136 0x00000001, | 136 0x00000001, |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 private: | 410 private: |
411 SkIRect fBase, fRect; | 411 SkIRect fBase, fRect; |
412 | 412 |
413 typedef SampleView INHERITED; | 413 typedef SampleView INHERITED; |
414 }; | 414 }; |
415 | 415 |
416 ////////////////////////////////////////////////////////////////////////////// | 416 ////////////////////////////////////////////////////////////////////////////// |
417 | 417 |
418 static SkView* MyFactory() { return new RegionView; } | 418 static SkView* MyFactory() { return new RegionView; } |
419 static SkViewRegister reg(MyFactory); | 419 static SkViewRegister reg(MyFactory); |
OLD | NEW |