OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/quads/largest_draw_quad.h" | 5 #include "cc/quads/largest_draw_quad.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 29 matching lines...) Expand all Loading... |
40 cc::StreamVideoDrawQuad, | 40 cc::StreamVideoDrawQuad, |
41 cc::SurfaceDrawQuad, | 41 cc::SurfaceDrawQuad, |
42 cc::TextureDrawQuad, | 42 cc::TextureDrawQuad, |
43 cc::TileDrawQuad, | 43 cc::TileDrawQuad, |
44 cc::YUVVideoDrawQuad>::value; | 44 cc::YUVVideoDrawQuad>::value; |
45 | 45 |
46 template <typename...> | 46 template <typename...> |
47 struct MaxAlign {}; | 47 struct MaxAlign {}; |
48 template <class T, class... Args> | 48 template <class T, class... Args> |
49 struct MaxAlign<T, Args...> { | 49 struct MaxAlign<T, Args...> { |
50 static constexpr size_t value = ALIGNOF(T) > MaxAlign<Args...>::value | 50 static constexpr size_t value = alignof(T) > MaxAlign<Args...>::value |
51 ? ALIGNOF(T) | 51 ? alignof(T) |
52 : MaxAlign<Args...>::value; | 52 : MaxAlign<Args...>::value; |
53 }; | 53 }; |
54 template <> | 54 template <> |
55 struct MaxAlign<> { | 55 struct MaxAlign<> { |
56 static constexpr size_t value = 0; | 56 static constexpr size_t value = 0; |
57 }; | 57 }; |
58 | 58 |
59 constexpr size_t kLargestDrawQuadAlignment = | 59 constexpr size_t kLargestDrawQuadAlignment = |
60 MaxAlign<cc::DebugBorderDrawQuad, | 60 MaxAlign<cc::DebugBorderDrawQuad, |
61 cc::PictureDrawQuad, | 61 cc::PictureDrawQuad, |
(...skipping 11 matching lines...) Expand all Loading... |
73 | 73 |
74 size_t LargestDrawQuadSize() { | 74 size_t LargestDrawQuadSize() { |
75 return kLargestDrawQuadSize; | 75 return kLargestDrawQuadSize; |
76 } | 76 } |
77 | 77 |
78 size_t LargestDrawQuadAlignment() { | 78 size_t LargestDrawQuadAlignment() { |
79 return kLargestDrawQuadAlignment; | 79 return kLargestDrawQuadAlignment; |
80 } | 80 } |
81 | 81 |
82 } // namespace cc | 82 } // namespace cc |
OLD | NEW |