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

Side by Side Diff: src/core/SkPaint.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/core/SkMatrix.cpp ('k') | src/core/SkPictureRecord.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 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 "SkPaint.h" 8 #include "SkPaint.h"
9 #include "SkAnnotation.h" 9 #include "SkAnnotation.h"
10 #include "SkAutoKern.h" 10 #include "SkAutoKern.h"
(...skipping 2401 matching lines...) Expand 10 before | Expand all | Expand 10 after
2412 default: 2412 default:
2413 break; 2413 break;
2414 } 2414 }
2415 } 2415 }
2416 return false; 2416 return false;
2417 } 2417 }
2418 2418
2419 uint32_t SkPaint::getHash() const { 2419 uint32_t SkPaint::getHash() const {
2420 // We're going to hash 10 pointers and 7 32-bit values, finishing up with fB itfields, 2420 // We're going to hash 10 pointers and 7 32-bit values, finishing up with fB itfields,
2421 // so fBitfields should be 10 pointers and 6 32-bit values from the start. 2421 // so fBitfields should be 10 pointers and 6 32-bit values from the start.
2422 SK_COMPILE_ASSERT(offsetof(SkPaint, fBitfields) == 10 * sizeof(void*) + 6 * sizeof(uint32_t), 2422 static_assert(offsetof(SkPaint, fBitfields) == 10 * sizeof(void*) + 6 * size of(uint32_t),
2423 SkPaint_notPackedTightly); 2423 "SkPaint_notPackedTightly");
2424 return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(this), 2424 return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(this),
2425 offsetof(SkPaint, fBitfields) + sizeof(fBitfields )); 2425 offsetof(SkPaint, fBitfields) + sizeof(fBitfields ));
2426 } 2426 }
OLDNEW
« no previous file with comments | « src/core/SkMatrix.cpp ('k') | src/core/SkPictureRecord.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698