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

Side by Side Diff: src/utils/SkParseColor.cpp

Issue 227043006: Fixed Skia compilation error with strict clang. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 8 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 | « AUTHORS ('k') | no next file » | 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 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
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 9
10 #include "SkParse.h" 10 #include "SkParse.h"
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 SkASSERT(FindColor(nameRGB.name, &result) != NULL); 506 SkASSERT(FindColor(nameRGB.name, &result) != NULL);
507 SkASSERT(result == (SkColor) (nameRGB.rgb | 0xFF000000)); 507 SkASSERT(result == (SkColor) (nameRGB.rgb | 0xFF000000));
508 } 508 }
509 for (index = 0; index < colorNamesSize; index++) { 509 for (index = 0; index < colorNamesSize; index++) {
510 result = SK_ColorBLACK; 510 result = SK_ColorBLACK;
511 SkNameRGB nameRGB = colorNames[index]; 511 SkNameRGB nameRGB = colorNames[index];
512 char bad[24]; 512 char bad[24];
513 size_t len = strlen(nameRGB.name); 513 size_t len = strlen(nameRGB.name);
514 memcpy(bad, nameRGB.name, len); 514 memcpy(bad, nameRGB.name, len);
515 bad[len - 1] -= 1; 515 bad[len - 1] -= 1;
516 SkASSERT(FindColor(bad, &result) == false); 516 SkASSERT(FindColor(bad, &result) == NULL);
517 bad[len - 1] += 2; 517 bad[len - 1] += 2;
518 SkASSERT(FindColor(bad, &result) == false); 518 SkASSERT(FindColor(bad, &result) == NULL);
519 } 519 }
520 result = SK_ColorBLACK; 520 result = SK_ColorBLACK;
521 SkASSERT(FindColor("lightGrey", &result)); 521 SkASSERT(FindColor("lightGrey", &result));
522 SkASSERT(result == 0xffd3d3d3); 522 SkASSERT(result == 0xffd3d3d3);
523 // SkASSERT(FindColor("12,34,56,78", &result)); 523 // SkASSERT(FindColor("12,34,56,78", &result));
524 // SkASSERT(result == ((12 << 24) | (34 << 16) | (56 << 8) | (78 << 0))); 524 // SkASSERT(result == ((12 << 24) | (34 << 16) | (56 << 8) | (78 << 0)));
525 result = SK_ColorBLACK; 525 result = SK_ColorBLACK;
526 SkASSERT(FindColor("#ABCdef", &result)); 526 SkASSERT(FindColor("#ABCdef", &result));
527 SkASSERT(result == 0XFFABCdef); 527 SkASSERT(result == 0XFFABCdef);
528 SkASSERT(FindColor("#12ABCdef", &result)); 528 SkASSERT(FindColor("#12ABCdef", &result));
529 SkASSERT(result == 0X12ABCdef); 529 SkASSERT(result == 0X12ABCdef);
530 result = SK_ColorBLACK; 530 result = SK_ColorBLACK;
531 SkASSERT(FindColor("#123", &result)); 531 SkASSERT(FindColor("#123", &result));
532 SkASSERT(result == 0Xff112233); 532 SkASSERT(result == 0Xff112233);
533 SkASSERT(FindColor("#abcd", &result)); 533 SkASSERT(FindColor("#abcd", &result));
534 SkASSERT(result == 0Xaabbccdd); 534 SkASSERT(result == 0Xaabbccdd);
535 result = SK_ColorBLACK; 535 result = SK_ColorBLACK;
536 // SkASSERT(FindColor("71,162,253", &result)); 536 // SkASSERT(FindColor("71,162,253", &result));
537 // SkASSERT(result == ((0xFF << 24) | (71 << 16) | (162 << 8) | (253 << 0))); 537 // SkASSERT(result == ((0xFF << 24) | (71 << 16) | (162 << 8) | (253 << 0)));
538 } 538 }
539 #endif 539 #endif
OLDNEW
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698