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

Side by Side Diff: include/gpu/GrTypes.h

Issue 2225303002: Add flag for window rectangles to GrRenderTarget (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add GrRenderTarget flag for window rectangles 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/gpu/GrRenderTarget.h ('k') | include/private/GrInstancedPipelineInfo.h » ('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 2010 Google Inc. 2 * Copyright 2010 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 #ifndef GrTypes_DEFINED 8 #ifndef GrTypes_DEFINED
9 #define GrTypes_DEFINED 9 #define GrTypes_DEFINED
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 friend X operator | (X a, X b); \ 42 friend X operator | (X a, X b); \
43 friend X& operator |= (X& a, X b); \ 43 friend X& operator |= (X& a, X b); \
44 \ 44 \
45 friend X operator & (X a, X b); \ 45 friend X operator & (X a, X b); \
46 \ 46 \
47 template <typename T> \ 47 template <typename T> \
48 friend X operator & (T a, X b); \ 48 friend X operator & (T a, X b); \
49 \ 49 \
50 template <typename T> \ 50 template <typename T> \
51 friend X operator & (X a, T b); \ 51 friend X operator & (X a, T b); \
52
53 /**
54 * Defines bitwise operators that make it possible to use an enum class as a
55 * very basic bitfield.
56 */
57 #define GR_MAKE_BITFIELD_CLASS_OPS(X) \
58 inline X operator | (X a, X b) { \
59 return (X) ((int)a | (int)b); \
60 } \
61 inline X& operator |= (X& a, X b) { \
62 return (a = a | b); \
63 } \
64 inline bool operator & (X a, X b) { \
65 return SkToBool((int)a & (int)b); \
66 }
67
68 #define GR_DECL_BITFIELD_CLASS_OPS_FRIENDS(X) \
69 friend X operator | (X a, X b); \
70 friend X& operator |= (X& a, X b); \
71 friend bool operator & (X a, X b);
72
52 //////////////////////////////////////////////////////////////////////////////// 73 ////////////////////////////////////////////////////////////////////////////////
53 74
54 // compile time versions of min/max 75 // compile time versions of min/max
55 #define GR_CT_MAX(a, b) (((b) < (a)) ? (a) : (b)) 76 #define GR_CT_MAX(a, b) (((b) < (a)) ? (a) : (b))
56 #define GR_CT_MIN(a, b) (((b) < (a)) ? (b) : (a)) 77 #define GR_CT_MIN(a, b) (((b) < (a)) ? (b) : (a))
57 78
58 /** 79 /**
59 * divide, rounding up 80 * divide, rounding up
60 */ 81 */
61 static inline int32_t GrIDivRoundUp(int x, int y) { 82 static inline int32_t GrIDivRoundUp(int x, int y) {
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 return 4 * width * height; 656 return 4 * width * height;
636 } 657 }
637 } 658 }
638 659
639 /** 660 /**
640 * This value translates to reseting all the context state for any backend. 661 * This value translates to reseting all the context state for any backend.
641 */ 662 */
642 static const uint32_t kAll_GrBackendState = 0xffffffff; 663 static const uint32_t kAll_GrBackendState = 0xffffffff;
643 664
644 #endif 665 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrRenderTarget.h ('k') | include/private/GrInstancedPipelineInfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698