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

Side by Side Diff: cc/quads/largest_draw_quad.cc

Issue 2932053002: Use C++11 alignment primitives (Closed)
Patch Set: Fix merge Created 3 years, 6 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 | « cc/paint/paint_op_buffer.cc ('k') | cc/quads/render_pass.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/paint/paint_op_buffer.cc ('k') | cc/quads/render_pass.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698