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

Side by Side Diff: src/core/SkLiteDL.cpp

Issue 2233853002: constexpr NaN,+Inf,-Inf (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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 | « include/private/SkFloatingPoint.h ('k') | src/core/SkMath.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 2016 Google Inc. 2 * Copyright 2016 Google Inc.
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 "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkData.h" 9 #include "SkData.h"
10 #include "SkImageFilter.h" 10 #include "SkImageFilter.h"
11 #include "SkLiteDL.h" 11 #include "SkLiteDL.h"
12 #include "SkPicture.h" 12 #include "SkPicture.h"
13 #include "SkMutex.h" 13 #include "SkMutex.h"
14 #include "SkRSXform.h" 14 #include "SkRSXform.h"
15 #include "SkSpinlock.h" 15 #include "SkSpinlock.h"
16 #include "SkTextBlob.h" 16 #include "SkTextBlob.h"
17 #include <math.h>
18 17
19 // A stand-in for an optional SkRect which was not set, e.g. bounds for a saveLa yer(). 18 // A stand-in for an optional SkRect which was not set, e.g. bounds for a saveLa yer().
20 static const SkRect kUnset = {(SkScalar)INFINITY, 0,0,0}; 19 static const SkRect kUnset = { SK_ScalarInfinity, 0,0,0};
21 static const SkRect* maybe_unset(const SkRect& r) { 20 static const SkRect* maybe_unset(const SkRect& r) {
22 return r.left() == (SkScalar)INFINITY ? nullptr : &r; 21 return r.left() == SK_ScalarInfinity ? nullptr : &r;
23 } 22 }
24 23
25 // copy_v(dst, src,n, src,n, ...) copies an arbitrary number of typed srcs into dst. 24 // copy_v(dst, src,n, src,n, ...) copies an arbitrary number of typed srcs into dst.
26 static void copy_v(void* dst) {} 25 static void copy_v(void* dst) {}
27 26
28 template <typename S, typename... Rest> 27 template <typename S, typename... Rest>
29 static void copy_v(void* dst, const S* src, int n, Rest&&... rest) { 28 static void copy_v(void* dst, const S* src, int n, Rest&&... rest) {
30 SkASSERTF(((uintptr_t)dst & (alignof(S)-1)) == 0, 29 SkASSERTF(((uintptr_t)dst & (alignof(S)-1)) == 0,
31 "Expected %p to be aligned for at least %zu bytes.", dst, alignof( S)); 30 "Expected %p to be aligned for at least %zu bytes.", dst, alignof( S));
32 sk_careful_memcpy(dst, src, n*sizeof(S)); 31 sk_careful_memcpy(dst, src, n*sizeof(S));
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 } 720 }
722 721
723 void SkLiteDL::PurgeFreelist() { 722 void SkLiteDL::PurgeFreelist() {
724 SkAutoMutexAcquire lock(gFreeStackLock); 723 SkAutoMutexAcquire lock(gFreeStackLock);
725 while (gFreeStack) { 724 while (gFreeStack) {
726 SkLiteDL* top = gFreeStack; 725 SkLiteDL* top = gFreeStack;
727 gFreeStack = gFreeStack->fNext; 726 gFreeStack = gFreeStack->fNext;
728 delete top; // Calling unref() here would just put it back on the list ! 727 delete top; // Calling unref() here would just put it back on the list !
729 } 728 }
730 } 729 }
OLDNEW
« no previous file with comments | « include/private/SkFloatingPoint.h ('k') | src/core/SkMath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698