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_image_serialization_processor.h" | 5 #include "cc/test/fake_image_serialization_processor.h" |
6 | 6 |
| 7 #include "base/memory/ptr_util.h" |
| 8 #include "cc/proto/picture_cache.h" |
| 9 #include "cc/test/fake_picture_cache.h" |
7 #include "third_party/skia/include/core/SkPicture.h" | 10 #include "third_party/skia/include/core/SkPicture.h" |
8 | 11 |
9 namespace { | |
10 bool NoopDecoder(const void* input, size_t input_size, SkBitmap* bitmap) { | |
11 return false; | |
12 } | |
13 } | |
14 | |
15 class SkPixelSerializer; | 12 class SkPixelSerializer; |
16 | 13 |
17 namespace cc { | 14 namespace cc { |
18 | 15 |
19 FakeImageSerializationProcessor::FakeImageSerializationProcessor() {} | 16 FakeImageSerializationProcessor::FakeImageSerializationProcessor() |
| 17 : picture_cache_model_(base::WrapUnique(new FakePictureCacheModel)) {} |
20 | 18 |
21 FakeImageSerializationProcessor::~FakeImageSerializationProcessor() {} | 19 FakeImageSerializationProcessor::~FakeImageSerializationProcessor() {} |
22 | 20 |
23 SkPixelSerializer* FakeImageSerializationProcessor::GetPixelSerializer() { | 21 std::unique_ptr<EnginePictureCache> |
24 return nullptr; | 22 FakeImageSerializationProcessor::CreateEnginePictureCache() { |
| 23 return base::WrapUnique( |
| 24 new FakeEnginePictureCache(picture_cache_model_.get())); |
25 } | 25 } |
26 | 26 |
27 SkPicture::InstallPixelRefProc | 27 std::unique_ptr<ClientPictureCache> |
28 FakeImageSerializationProcessor::GetPixelDeserializer() { | 28 FakeImageSerializationProcessor::CreateClientPictureCache() { |
29 return &NoopDecoder; | 29 return base::WrapUnique( |
| 30 new FakeClientPictureCache(picture_cache_model_.get())); |
30 } | 31 } |
31 | 32 |
32 } // namespace cc | 33 } // namespace cc |
OLD | NEW |