OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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/playback/display_item_proto_factory.h" | 5 #include "cc/playback/display_item_proto_factory.h" |
6 | 6 |
7 #include "cc/playback/clip_display_item.h" | 7 #include "cc/playback/clip_display_item.h" |
8 #include "cc/playback/clip_path_display_item.h" | 8 #include "cc/playback/clip_path_display_item.h" |
9 #include "cc/playback/compositing_display_item.h" | 9 #include "cc/playback/compositing_display_item.h" |
10 #include "cc/playback/drawing_display_item.h" | 10 #include "cc/playback/drawing_display_item.h" |
11 #include "cc/playback/filter_display_item.h" | 11 #include "cc/playback/filter_display_item.h" |
12 #include "cc/playback/float_clip_display_item.h" | 12 #include "cc/playback/float_clip_display_item.h" |
13 #include "cc/playback/transform_display_item.h" | 13 #include "cc/playback/transform_display_item.h" |
14 #include "cc/proto/display_item.pb.h" | 14 #include "cc/proto/display_item.pb.h" |
15 #include "ui/gfx/geometry/rect.h" | 15 #include "ui/gfx/geometry/rect.h" |
16 | 16 |
17 namespace cc { | 17 namespace cc { |
18 class ImageSerializationProcessor; | 18 class ClientPictureCache; |
19 | 19 |
20 // static | 20 // static |
21 void DisplayItemProtoFactory::AllocateAndConstruct( | 21 void DisplayItemProtoFactory::AllocateAndConstruct( |
22 const gfx::Rect& visual_rect, | 22 const gfx::Rect& visual_rect, |
23 DisplayItemList* list, | 23 DisplayItemList* list, |
24 const proto::DisplayItem& proto, | 24 const proto::DisplayItem& proto, |
25 ImageSerializationProcessor* image_serialization_processor) { | 25 ClientPictureCache* client_picture_cache) { |
26 switch (proto.type()) { | 26 switch (proto.type()) { |
27 case proto::DisplayItem::Type_Clip: | 27 case proto::DisplayItem::Type_Clip: |
28 list->CreateAndAppendItem<ClipDisplayItem>(visual_rect, proto); | 28 list->CreateAndAppendItem<ClipDisplayItem>(visual_rect, proto); |
29 return; | 29 return; |
30 case proto::DisplayItem::Type_EndClip: | 30 case proto::DisplayItem::Type_EndClip: |
31 list->CreateAndAppendItem<EndClipDisplayItem>(visual_rect, proto); | 31 list->CreateAndAppendItem<EndClipDisplayItem>(visual_rect, proto); |
32 return; | 32 return; |
33 case proto::DisplayItem::Type_ClipPath: | 33 case proto::DisplayItem::Type_ClipPath: |
34 list->CreateAndAppendItem<ClipPathDisplayItem>(visual_rect, proto); | 34 list->CreateAndAppendItem<ClipPathDisplayItem>(visual_rect, proto); |
35 return; | 35 return; |
36 case proto::DisplayItem::Type_EndClipPath: | 36 case proto::DisplayItem::Type_EndClipPath: |
37 list->CreateAndAppendItem<EndClipPathDisplayItem>(visual_rect, proto); | 37 list->CreateAndAppendItem<EndClipPathDisplayItem>(visual_rect, proto); |
38 return; | 38 return; |
39 case proto::DisplayItem::Type_Compositing: | 39 case proto::DisplayItem::Type_Compositing: |
40 list->CreateAndAppendItem<CompositingDisplayItem>(visual_rect, proto); | 40 list->CreateAndAppendItem<CompositingDisplayItem>(visual_rect, proto); |
41 return; | 41 return; |
42 case proto::DisplayItem::Type_EndCompositing: | 42 case proto::DisplayItem::Type_EndCompositing: |
43 list->CreateAndAppendItem<EndCompositingDisplayItem>(visual_rect, proto); | 43 list->CreateAndAppendItem<EndCompositingDisplayItem>(visual_rect, proto); |
44 return; | 44 return; |
45 case proto::DisplayItem::Type_Drawing: | 45 case proto::DisplayItem::Type_Drawing: |
46 list->CreateAndAppendItem<DrawingDisplayItem>( | 46 list->CreateAndAppendItem<DrawingDisplayItem>(visual_rect, proto, |
47 visual_rect, proto, image_serialization_processor); | 47 client_picture_cache); |
48 return; | 48 return; |
49 case proto::DisplayItem::Type_Filter: | 49 case proto::DisplayItem::Type_Filter: |
50 list->CreateAndAppendItem<FilterDisplayItem>(visual_rect, proto); | 50 list->CreateAndAppendItem<FilterDisplayItem>(visual_rect, proto); |
51 return; | 51 return; |
52 case proto::DisplayItem::Type_EndFilter: | 52 case proto::DisplayItem::Type_EndFilter: |
53 list->CreateAndAppendItem<EndFilterDisplayItem>(visual_rect, proto); | 53 list->CreateAndAppendItem<EndFilterDisplayItem>(visual_rect, proto); |
54 return; | 54 return; |
55 case proto::DisplayItem::Type_FloatClip: | 55 case proto::DisplayItem::Type_FloatClip: |
56 list->CreateAndAppendItem<FloatClipDisplayItem>(visual_rect, proto); | 56 list->CreateAndAppendItem<FloatClipDisplayItem>(visual_rect, proto); |
57 return; | 57 return; |
58 case proto::DisplayItem::Type_EndFloatClip: | 58 case proto::DisplayItem::Type_EndFloatClip: |
59 list->CreateAndAppendItem<EndFloatClipDisplayItem>(visual_rect, proto); | 59 list->CreateAndAppendItem<EndFloatClipDisplayItem>(visual_rect, proto); |
60 return; | 60 return; |
61 case proto::DisplayItem::Type_Transform: | 61 case proto::DisplayItem::Type_Transform: |
62 list->CreateAndAppendItem<TransformDisplayItem>(visual_rect, proto); | 62 list->CreateAndAppendItem<TransformDisplayItem>(visual_rect, proto); |
63 return; | 63 return; |
64 case proto::DisplayItem::Type_EndTransform: | 64 case proto::DisplayItem::Type_EndTransform: |
65 list->CreateAndAppendItem<EndTransformDisplayItem>(visual_rect, proto); | 65 list->CreateAndAppendItem<EndTransformDisplayItem>(visual_rect, proto); |
66 return; | 66 return; |
67 } | 67 } |
68 | 68 |
69 NOTREACHED(); | 69 NOTREACHED(); |
70 } | 70 } |
71 | 71 |
72 } // namespace cc | 72 } // namespace cc |
OLD | NEW |