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/playback/display_item_proto_factory.h" |
| 6 |
| 7 #include "cc/playback/clip_display_item.h" |
| 8 #include "cc/playback/clip_path_display_item.h" |
| 9 #include "cc/playback/compositing_display_item.h" |
| 10 #include "cc/playback/drawing_display_item.h" |
| 11 #include "cc/playback/filter_display_item.h" |
| 12 #include "cc/playback/float_clip_display_item.h" |
| 13 #include "cc/playback/transform_display_item.h" |
| 14 #include "cc/proto/display_item.pb.h" |
| 15 |
| 16 namespace cc { |
| 17 |
| 18 // static |
| 19 DisplayItem* DisplayItemProtoFactory::AllocateAndConstruct( |
| 20 scoped_refptr<DisplayItemList> list, |
| 21 const proto::DisplayItem& proto) { |
| 22 switch (proto.type()) { |
| 23 case proto::DisplayItem::Type_Clip: |
| 24 return list->CreateAndAppendItem<ClipDisplayItem>(); |
| 25 case proto::DisplayItem::Type_EndClip: |
| 26 return list->CreateAndAppendItem<EndClipDisplayItem>(); |
| 27 case proto::DisplayItem::Type_ClipPath: |
| 28 return list->CreateAndAppendItem<ClipPathDisplayItem>(); |
| 29 case proto::DisplayItem::Type_EndClipPath: |
| 30 return list->CreateAndAppendItem<EndClipPathDisplayItem>(); |
| 31 case proto::DisplayItem::Type_Compositing: |
| 32 return list->CreateAndAppendItem<CompositingDisplayItem>(); |
| 33 case proto::DisplayItem::Type_EndCompositing: |
| 34 return list->CreateAndAppendItem<EndCompositingDisplayItem>(); |
| 35 case proto::DisplayItem::Type_Drawing: |
| 36 return list->CreateAndAppendItem<DrawingDisplayItem>(); |
| 37 case proto::DisplayItem::Type_Filter: |
| 38 return list->CreateAndAppendItem<FilterDisplayItem>(); |
| 39 case proto::DisplayItem::Type_EndFilter: |
| 40 return list->CreateAndAppendItem<EndFilterDisplayItem>(); |
| 41 case proto::DisplayItem::Type_FloatClip: |
| 42 return list->CreateAndAppendItem<FloatClipDisplayItem>(); |
| 43 case proto::DisplayItem::Type_EndFloatClip: |
| 44 return list->CreateAndAppendItem<EndFloatClipDisplayItem>(); |
| 45 case proto::DisplayItem::Type_Transform: |
| 46 return list->CreateAndAppendItem<TransformDisplayItem>(); |
| 47 case proto::DisplayItem::Type_EndTransform: |
| 48 return list->CreateAndAppendItem<EndTransformDisplayItem>(); |
| 49 default: |
| 50 return nullptr; |
| 51 } |
| 52 } |
| 53 |
| 54 } // namespace cc |
OLD | NEW |