Add @VisibleForTesting to fix ChromePublic release build.
[chromium-blink-merge.git] / cc / playback / largest_display_item.cc
blob0ecd3d0547a9d79df74b6fb823f80e7d6fcc5b25
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.
5 #include "cc/playback/largest_display_item.h"
7 #include <algorithm>
9 #include "cc/playback/clip_display_item.h"
10 #include "cc/playback/clip_path_display_item.h"
11 #include "cc/playback/compositing_display_item.h"
12 #include "cc/playback/drawing_display_item.h"
13 #include "cc/playback/filter_display_item.h"
14 #include "cc/playback/float_clip_display_item.h"
15 #include "cc/playback/transform_display_item.h"
17 #include "third_party/skia/include/core/SkPicture.h"
19 namespace {
20 const size_t kLargestDisplayItemSize = sizeof(cc::TransformDisplayItem);
21 } // namespace
23 namespace cc {
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.");
68 return kLargestDisplayItemSize;
71 } // namespace cc