OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 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 | 8 |
9 #include "SkRadialGradient.h" | 9 #include "SkRadialGradient.h" |
10 #include "SkRadialGradient_Table.h" | 10 #include "SkRadialGradient_Table.h" |
11 #include "SkNx.h" | 11 #include "SkNx.h" |
12 | 12 |
13 #define kSQRT_TABLE_BITS 11 | 13 #define kSQRT_TABLE_BITS 11 |
14 #define kSQRT_TABLE_SIZE (1 << kSQRT_TABLE_BITS) | 14 #define kSQRT_TABLE_SIZE (1 << kSQRT_TABLE_BITS) |
15 | 15 |
16 SK_COMPILE_ASSERT(sizeof(gSqrt8Table) == kSQRT_TABLE_SIZE, SqrtTableSizesMatch); | 16 static_assert(sizeof(gSqrt8Table) == kSQRT_TABLE_SIZE, "SqrtTableSizesMatch"); |
17 | 17 |
18 #if 0 | 18 #if 0 |
19 | 19 |
20 #include <stdio.h> | 20 #include <stdio.h> |
21 | 21 |
22 void SkRadialGradient_BuildTable() { | 22 void SkRadialGradient_BuildTable() { |
23 // build it 0..127 x 0..127, so we use 2^15 - 1 in the numerator for our "fi
xed" table | 23 // build it 0..127 x 0..127, so we use 2^15 - 1 in the numerator for our "fi
xed" table |
24 | 24 |
25 FILE* file = ::fopen("SkRadialGradient_Table.h", "w"); | 25 FILE* file = ::fopen("SkRadialGradient_Table.h", "w"); |
26 SkASSERT(file); | 26 SkASSERT(file); |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 str->appendScalar(fCenter.fY); | 561 str->appendScalar(fCenter.fY); |
562 str->append(") radius: "); | 562 str->append(") radius: "); |
563 str->appendScalar(fRadius); | 563 str->appendScalar(fRadius); |
564 str->append(" "); | 564 str->append(" "); |
565 | 565 |
566 this->INHERITED::toString(str); | 566 this->INHERITED::toString(str); |
567 | 567 |
568 str->append(")"); | 568 str->append(")"); |
569 } | 569 } |
570 #endif | 570 #endif |
OLD | NEW |