| 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 #include "ui/gfx/geometry/rect.h" | |
| 16 | |
| 17 namespace cc { | |
| 18 class ClientPictureCache; | |
| 19 | |
| 20 // static | |
| 21 void DisplayItemProtoFactory::AllocateAndConstruct( | |
| 22 const gfx::Rect& visual_rect, | |
| 23 DisplayItemList* list, | |
| 24 const proto::DisplayItem& proto, | |
| 25 ClientPictureCache* client_picture_cache, | |
| 26 std::vector<uint32_t>* used_engine_picture_ids) { | |
| 27 switch (proto.type()) { | |
| 28 case proto::DisplayItem::Type_Clip: | |
| 29 list->CreateAndAppendPairedBeginItem<ClipDisplayItem>(proto); | |
| 30 return; | |
| 31 case proto::DisplayItem::Type_EndClip: | |
| 32 list->CreateAndAppendPairedEndItem<EndClipDisplayItem>(proto); | |
| 33 return; | |
| 34 case proto::DisplayItem::Type_ClipPath: | |
| 35 list->CreateAndAppendPairedBeginItem<ClipPathDisplayItem>(proto); | |
| 36 return; | |
| 37 case proto::DisplayItem::Type_EndClipPath: | |
| 38 list->CreateAndAppendPairedEndItem<EndClipPathDisplayItem>(proto); | |
| 39 return; | |
| 40 case proto::DisplayItem::Type_Compositing: | |
| 41 list->CreateAndAppendPairedBeginItem<CompositingDisplayItem>(proto); | |
| 42 return; | |
| 43 case proto::DisplayItem::Type_EndCompositing: | |
| 44 list->CreateAndAppendPairedEndItem<EndCompositingDisplayItem>(proto); | |
| 45 return; | |
| 46 case proto::DisplayItem::Type_Drawing: | |
| 47 list->CreateAndAppendDrawingItem<DrawingDisplayItem>( | |
| 48 visual_rect, proto, client_picture_cache, used_engine_picture_ids); | |
| 49 return; | |
| 50 case proto::DisplayItem::Type_Filter: | |
| 51 list->CreateAndAppendPairedBeginItem<FilterDisplayItem>(proto); | |
| 52 return; | |
| 53 case proto::DisplayItem::Type_EndFilter: | |
| 54 list->CreateAndAppendPairedEndItem<EndFilterDisplayItem>(proto); | |
| 55 return; | |
| 56 case proto::DisplayItem::Type_FloatClip: | |
| 57 list->CreateAndAppendPairedBeginItem<FloatClipDisplayItem>(proto); | |
| 58 return; | |
| 59 case proto::DisplayItem::Type_EndFloatClip: | |
| 60 list->CreateAndAppendPairedEndItem<EndFloatClipDisplayItem>(proto); | |
| 61 return; | |
| 62 case proto::DisplayItem::Type_Transform: | |
| 63 list->CreateAndAppendPairedBeginItem<TransformDisplayItem>(proto); | |
| 64 return; | |
| 65 case proto::DisplayItem::Type_EndTransform: | |
| 66 list->CreateAndAppendPairedEndItem<EndTransformDisplayItem>(proto); | |
| 67 return; | |
| 68 } | |
| 69 | |
| 70 NOTREACHED(); | |
| 71 } | |
| 72 | |
| 73 } // namespace cc | |
| OLD | NEW |