| 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 #ifndef CC_TEST_FAKE_CLIENT_PICTURE_CACHE_H_ | 5 #ifndef CC_TEST_FAKE_CLIENT_PICTURE_CACHE_H_ |
| 6 #define CC_TEST_FAKE_CLIENT_PICTURE_CACHE_H_ | 6 #define CC_TEST_FAKE_CLIENT_PICTURE_CACHE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <memory> | 11 #include <memory> |
| 12 | 12 |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "cc/blimp/client_picture_cache.h" | 14 #include "cc/blimp/client_picture_cache.h" |
| 15 | 15 |
| 16 namespace cc { | 16 namespace cc { |
| 17 class PictureCacheModel; | 17 class PictureCacheModel; |
| 18 | 18 |
| 19 class FakeClientPictureCache : public ClientPictureCache { | 19 class FakeClientPictureCache : public ClientPictureCache { |
| 20 public: | 20 public: |
| 21 explicit FakeClientPictureCache(PictureCacheModel* model); | 21 explicit FakeClientPictureCache(PictureCacheModel* model); |
| 22 ~FakeClientPictureCache() override; | 22 ~FakeClientPictureCache() override; |
| 23 | 23 |
| 24 const std::vector<uint32_t>& GetAllUsedPictureIds(); | 24 const std::vector<uint32_t>& GetAllUsedPictureIds(); |
| 25 | 25 |
| 26 // ClientPictureCache implementation. | 26 // ClientPictureCache implementation. |
| 27 void MarkUsed(uint32_t engine_picture_id) override; | 27 void MarkUsed(uint32_t engine_picture_id) override; |
| 28 sk_sp<const SkPicture> GetPicture(uint32_t unique_id) override; | 28 sk_sp<const CdlPicture> GetPicture(uint32_t unique_id) override; |
| 29 void ApplyCacheUpdate(const std::vector<PictureData>& cache_update) override; | 29 void ApplyCacheUpdate(const std::vector<PictureData>& cache_update) override; |
| 30 void Flush() override; | 30 void Flush() override; |
| 31 | 31 |
| 32 private: | 32 private: |
| 33 PictureCacheModel* model_; | 33 PictureCacheModel* model_; |
| 34 std::vector<uint32_t> used_picture_ids_; | 34 std::vector<uint32_t> used_picture_ids_; |
| 35 | 35 |
| 36 DISALLOW_COPY_AND_ASSIGN(FakeClientPictureCache); | 36 DISALLOW_COPY_AND_ASSIGN(FakeClientPictureCache); |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 } // namespace cc | 39 } // namespace cc |
| 40 | 40 |
| 41 #endif // CC_TEST_FAKE_CLIENT_PICTURE_CACHE_H_ | 41 #endif // CC_TEST_FAKE_CLIENT_PICTURE_CACHE_H_ |
| OLD | NEW |