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

Unified Diff: src/xps/SkConstexprMath.h

Issue 2000853003: SkXPS: clean up SkConstexprMath (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-05-30 (Monday) 10:22:51 EDT Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gyp/xps.gyp ('k') | src/xps/SkXPSDevice.cpp » ('j') | src/xps/SkXPSDevice.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/xps/SkConstexprMath.h
diff --git a/src/xps/SkConstexprMath.h b/src/xps/SkConstexprMath.h
deleted file mode 100644
index 9625d5112b13b492952113fc9d25af8678037c14..0000000000000000000000000000000000000000
--- a/src/xps/SkConstexprMath.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2011 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef SkConstexprMath_DEFINED
-#define SkConstexprMath_DEFINED
-
-#include "SkTypes.h"
-#include <limits.h>
-
-template <uintmax_t N, uintmax_t B>
-struct SK_LOG {
- //! Compile-time constant ceiling(logB(N)).
- static const uintmax_t value = 1 + SK_LOG<N/B, B>::value;
-};
-template <uintmax_t B>
-struct SK_LOG<1, B> {
- static const uintmax_t value = 0;
-};
-template <uintmax_t B>
-struct SK_LOG<0, B> {
- static const uintmax_t value = 0;
-};
-
-template<uintmax_t N>
-struct SK_2N1 {
- //! Compile-time constant (2^N)-1.
- static const uintmax_t value = (SK_2N1<N-1>::value << 1) + 1;
-};
-template<>
-struct SK_2N1<1> {
- static const uintmax_t value = 1;
-};
-
-/** Compile-time constant number of base n digits in type t
- if the bits of type t are considered as unsigned base two.
-*/
-#define SK_BASE_N_DIGITS_IN(n, t) (\
- SK_LOG<SK_2N1<(sizeof(t) * CHAR_BIT)>::value, n>::value\
-)
-/** Compile-time constant number of base 10 digits in type t
- if the bits of type t are considered as unsigned base two.
-*/
-#define SK_DIGITS_IN(t) SK_BASE_N_DIGITS_IN(10, (t))
-
-// Compile-time constant maximum value of two unsigned values.
-template <uintmax_t a, uintmax_t b> struct SkTUMax {
- static const uintmax_t value = (b < a) ? a : b;
-};
-
-#endif
« no previous file with comments | « gyp/xps.gyp ('k') | src/xps/SkXPSDevice.cpp » ('j') | src/xps/SkXPSDevice.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698