OLD | NEW |
| (Empty) |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "cc/resources/largest_display_item.h" | |
6 | |
7 #include <algorithm> | |
8 | |
9 #include "cc/resources/clip_display_item.h" | |
10 #include "cc/resources/clip_path_display_item.h" | |
11 #include "cc/resources/compositing_display_item.h" | |
12 #include "cc/resources/drawing_display_item.h" | |
13 #include "cc/resources/filter_display_item.h" | |
14 #include "cc/resources/float_clip_display_item.h" | |
15 #include "cc/resources/transform_display_item.h" | |
16 | |
17 #include "third_party/skia/include/core/SkPicture.h" | |
18 | |
19 namespace { | |
20 const size_t kLargestDisplayItemSize = sizeof(cc::TransformDisplayItem); | |
21 } // namespace | |
22 | |
23 namespace cc { | |
24 | |
25 size_t LargestDisplayItemSize() { | |
26 // Use compile assert to make sure largest is actually larger than all other | |
27 // type of display_items. | |
28 static_assert(sizeof(ClipDisplayItem) <= kLargestDisplayItemSize, | |
29 "Largest Draw Quad size needs update. ClipDisplayItem" | |
30 " is currently largest."); | |
31 static_assert(sizeof(EndClipDisplayItem) <= kLargestDisplayItemSize, | |
32 "Largest Draw Quad size needs update. EndClipDisplayItem" | |
33 " is currently largest."); | |
34 static_assert(sizeof(ClipPathDisplayItem) <= kLargestDisplayItemSize, | |
35 "Largest Draw Quad size needs update. ClipPathDisplayItem" | |
36 " is currently largest."); | |
37 static_assert(sizeof(EndClipPathDisplayItem) <= kLargestDisplayItemSize, | |
38 "Largest Draw Quad size needs update. EndClipPathDisplayItem" | |
39 " is currently largest."); | |
40 static_assert(sizeof(CompositingDisplayItem) <= kLargestDisplayItemSize, | |
41 "Largest Draw Quad size needs update. CompositingDisplayItem" | |
42 " is currently largest."); | |
43 static_assert(sizeof(EndCompositingDisplayItem) <= kLargestDisplayItemSize, | |
44 "Largest Draw Quad size needs update. EndCompositingDisplayItem" | |
45 " is currently largest."); | |
46 static_assert(sizeof(DrawingDisplayItem) <= kLargestDisplayItemSize, | |
47 "Largest Draw Quad size needs update. DrawingDisplayItem" | |
48 " is currently largest."); | |
49 static_assert(sizeof(FilterDisplayItem) <= kLargestDisplayItemSize, | |
50 "Largest Draw Quad size needs update. FilterDisplayItem" | |
51 " is currently largest."); | |
52 static_assert(sizeof(EndFilterDisplayItem) <= kLargestDisplayItemSize, | |
53 "Largest Draw Quad size needs update. EndFilterDisplayItem" | |
54 " is currently largest."); | |
55 static_assert(sizeof(FloatClipDisplayItem) <= kLargestDisplayItemSize, | |
56 "Largest Draw Quad size needs update. FloatClipDisplayItem" | |
57 " is currently largest."); | |
58 static_assert(sizeof(EndFloatClipDisplayItem) <= kLargestDisplayItemSize, | |
59 "Largest Draw Quad size needs update. EndFloatClipDisplayItem" | |
60 " is currently largest."); | |
61 static_assert(sizeof(TransformDisplayItem) <= kLargestDisplayItemSize, | |
62 "Largest Draw Quad size needs update. TransformDisplayItem" | |
63 " is currently largest."); | |
64 static_assert(sizeof(EndTransformDisplayItem) <= kLargestDisplayItemSize, | |
65 "Largest Draw Quad size needs update. EndTransformDisplayItem" | |
66 " is currently largest."); | |
67 | |
68 return kLargestDisplayItemSize; | |
69 } | |
70 | |
71 } // namespace cc | |
OLD | NEW |