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

Side by Side Diff: include/private/SkBitmaskEnum.h

Issue 2246903002: SkPDF: SkPDFFont class changes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-08-15 (Monday) 21:25:47 EDT 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/core/SkTypeface.h ('k') | src/core/SkAdvancedTypefaceMetrics.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2016 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7 #ifndef SkEnumOperators_DEFINED
8 #define SkEnumOperators_DEFINED
9
10 #include "SkTLogic.h"
11
12 namespace skstd {
13 template <typename T> struct is_bitmask_enum : std::false_type {};
14 }
15
16 template <typename E> SK_WHEN(skstd::is_bitmask_enum<E>::value, E) operator|(E l , E r) {
17 using U = skstd::underlying_type_t<E>;
18 return static_cast<E>(static_cast<U>(l) | static_cast<U>(r));
19 }
20
21 template <typename E> SK_WHEN(skstd::is_bitmask_enum<E>::value, E&) operator|=(E & l, E r) {
22 return l = l | r;
23 }
24
25 template <typename E> SK_WHEN(skstd::is_bitmask_enum<E>::value, E) operator&(E l , E r) {
26 using U = skstd::underlying_type_t<E>;
27 return static_cast<E>(static_cast<U>(l) & static_cast<U>(r));
28 }
29
30 template <typename E> SK_WHEN(skstd::is_bitmask_enum<E>::value, E&) operator&=(E & l, E r) {
31 return l = l & r;
32 }
33
34 #endif // SkEnumOperators_DEFINED
OLDNEW
« no previous file with comments | « include/core/SkTypeface.h ('k') | src/core/SkAdvancedTypefaceMetrics.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698