| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/test/fake_engine_picture_cache.h" | 5 #include "cc/test/fake_engine_picture_cache.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "cc/blimp/picture_data.h" | 10 #include "cc/blimp/picture_data.h" |
| 11 #include "cc/playback/display_item_list.h" | 11 #include "cc/playback/display_item_list.h" |
| 12 #include "cc/test/picture_cache_model.h" | 12 #include "cc/test/picture_cache_model.h" |
| 13 #include "third_party/skia/include/core/SkPicture.h" | 13 #include "skia/ext/cdl_picture.h" |
| 14 | 14 |
| 15 namespace cc { | 15 namespace cc { |
| 16 | 16 |
| 17 FakeEnginePictureCache::FakeEnginePictureCache(PictureCacheModel* model) | 17 FakeEnginePictureCache::FakeEnginePictureCache(PictureCacheModel* model) |
| 18 : model_(model) {} | 18 : model_(model) {} |
| 19 | 19 |
| 20 FakeEnginePictureCache::~FakeEnginePictureCache() {} | 20 FakeEnginePictureCache::~FakeEnginePictureCache() {} |
| 21 | 21 |
| 22 void FakeEnginePictureCache::MarkAllSkPicturesAsUsed( | 22 void FakeEnginePictureCache::MarkAllSkPicturesAsUsed( |
| 23 const DisplayItemList* display_list) { | 23 const DisplayItemList* display_list) { |
| 24 if (!display_list) | 24 if (!display_list) |
| 25 return; | 25 return; |
| 26 | 26 |
| 27 for (auto it = display_list->begin(); it != display_list->end(); ++it) { | 27 for (auto it = display_list->begin(); it != display_list->end(); ++it) { |
| 28 sk_sp<const SkPicture> picture = it->GetPicture(); | 28 sk_sp<const CdlPicture> picture = it->GetPicture(); |
| 29 if (!picture) | 29 if (!picture) |
| 30 continue; | 30 continue; |
| 31 | 31 |
| 32 MarkUsed(picture.get()); | 32 MarkUsed(picture.get()); |
| 33 } | 33 } |
| 34 } | 34 } |
| 35 | 35 |
| 36 const std::vector<uint32_t>& FakeEnginePictureCache::GetAllUsedPictureIds() { | 36 const std::vector<uint32_t>& FakeEnginePictureCache::GetAllUsedPictureIds() { |
| 37 return used_picture_ids_; | 37 return used_picture_ids_; |
| 38 } | 38 } |
| 39 | 39 |
| 40 void FakeEnginePictureCache::MarkUsed(const SkPicture* picture) { | 40 void FakeEnginePictureCache::MarkUsed(const CdlPicture* picture) { |
| 41 if (model_) | 41 if (model_) |
| 42 model_->AddPicture(picture); | 42 model_->AddPicture(picture); |
| 43 used_picture_ids_.push_back(picture->uniqueID()); | 43 used_picture_ids_.push_back(picture->uniqueID()); |
| 44 } | 44 } |
| 45 | 45 |
| 46 std::vector<PictureData> | 46 std::vector<PictureData> |
| 47 FakeEnginePictureCache::CalculateCacheUpdateAndFlush() { | 47 FakeEnginePictureCache::CalculateCacheUpdateAndFlush() { |
| 48 return std::vector<PictureData>(); | 48 return std::vector<PictureData>(); |
| 49 } | 49 } |
| 50 | 50 |
| 51 } // namespace cc | 51 } // namespace cc |
| OLD | NEW |