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