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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "cc/quads/checkerboard_draw_quad.h" | 9 #include "cc/quads/checkerboard_draw_quad.h" |
10 #include "cc/quads/debug_border_draw_quad.h" | 10 #include "cc/quads/debug_border_draw_quad.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 } // namespace | 26 } // namespace |
27 | 27 |
28 namespace cc { | 28 namespace cc { |
29 | 29 |
30 size_t LargestDrawQuadSize() { | 30 size_t LargestDrawQuadSize() { |
31 // Currently the largest quad is either a RenderPassDrawQuad or a | 31 // Currently the largest quad is either a RenderPassDrawQuad or a |
32 // StreamVideoDrawQuad depends on hardware structure. | 32 // StreamVideoDrawQuad depends on hardware structure. |
33 | 33 |
34 // Use compile assert to make sure largest is actually larger than all other | 34 // Use compile assert to make sure largest is actually larger than all other |
35 // type of draw quads. | 35 // type of draw quads. |
36 COMPILE_ASSERT(sizeof(CheckerboardDrawQuad) <= kLargestDrawQuadSize, | 36 static_assert(sizeof(CheckerboardDrawQuad) <= kLargestDrawQuadSize, |
37 "Largest Draw Quad size needs update. CheckerboardDrawQuad is " | 37 "Largest Draw Quad size needs update. CheckerboardDrawQuad is " |
38 "currently largest."); | 38 "currently largest."); |
39 COMPILE_ASSERT(sizeof(DebugBorderDrawQuad) <= kLargestDrawQuadSize, | 39 static_assert(sizeof(DebugBorderDrawQuad) <= kLargestDrawQuadSize, |
40 "Largest Draw Quad size needs update. DebugBorderDrawQuad is " | 40 "Largest Draw Quad size needs update. DebugBorderDrawQuad is " |
41 "currently largest."); | 41 "currently largest."); |
42 COMPILE_ASSERT(sizeof(IOSurfaceDrawQuad) <= kLargestDrawQuadSize, | 42 static_assert(sizeof(IOSurfaceDrawQuad) <= kLargestDrawQuadSize, |
43 "Largest Draw Quad size needs update. IOSurfaceDrawQuad is " | 43 "Largest Draw Quad size needs update. IOSurfaceDrawQuad is " |
44 "currently largest."); | 44 "currently largest."); |
45 COMPILE_ASSERT(sizeof(PictureDrawQuad) <= kLargestDrawQuadSize, | 45 static_assert(sizeof(PictureDrawQuad) <= kLargestDrawQuadSize, |
46 "Largest Draw Quad size needs update. PictureDrawQuad is " | 46 "Largest Draw Quad size needs update. PictureDrawQuad is " |
47 "currently largest."); | 47 "currently largest."); |
48 COMPILE_ASSERT(sizeof(TextureDrawQuad) <= kLargestDrawQuadSize, | 48 static_assert(sizeof(TextureDrawQuad) <= kLargestDrawQuadSize, |
49 "Largest Draw Quad size needs update. TextureDrawQuad is " | 49 "Largest Draw Quad size needs update. TextureDrawQuad is " |
50 "currently largest."); | 50 "currently largest."); |
51 COMPILE_ASSERT(sizeof(SolidColorDrawQuad) <= kLargestDrawQuadSize, | 51 static_assert(sizeof(SolidColorDrawQuad) <= kLargestDrawQuadSize, |
52 "Largest Draw Quad size needs update. SolidColorDrawQuad is " | 52 "Largest Draw Quad size needs update. SolidColorDrawQuad is " |
53 "currently largest."); | 53 "currently largest."); |
54 COMPILE_ASSERT(sizeof(SurfaceDrawQuad) <= kLargestDrawQuadSize, | 54 static_assert(sizeof(SurfaceDrawQuad) <= kLargestDrawQuadSize, |
55 "Largest Draw Quad size needs update. SurfaceDrawQuad is " | 55 "Largest Draw Quad size needs update. SurfaceDrawQuad is " |
56 "currently largest."); | 56 "currently largest."); |
57 COMPILE_ASSERT(sizeof(TileDrawQuad) <= kLargestDrawQuadSize, | 57 static_assert(sizeof(TileDrawQuad) <= kLargestDrawQuadSize, |
58 "Largest Draw Quad size needs update. TileDrawQuad is " | 58 "Largest Draw Quad size needs update. TileDrawQuad is " |
59 "currently largest."); | 59 "currently largest."); |
60 COMPILE_ASSERT(sizeof(YUVVideoDrawQuad) <= kLargestDrawQuadSize, | 60 static_assert(sizeof(YUVVideoDrawQuad) <= kLargestDrawQuadSize, |
61 "Largest Draw Quad size needs update. YUVVideoDrawQuad is " | 61 "Largest Draw Quad size needs update. YUVVideoDrawQuad is " |
62 "currently largest."); | 62 "currently largest."); |
63 | 63 |
64 return kLargestDrawQuadSize; | 64 return kLargestDrawQuadSize; |
65 } | 65 } |
66 | 66 |
67 } // namespace cc | 67 } // namespace cc |
OLD | NEW |