Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Side by Side Diff: src/effects/gradients/SkRadialGradient.cpp

Issue 1306443004: Use static_assert instead of SK_COMPILE_ASSERT. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/effects/SkDropShadowImageFilter.cpp ('k') | src/gpu/GrAtlasTextContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « src/effects/SkDropShadowImageFilter.cpp ('k') | src/gpu/GrAtlasTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698