| 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 "blimp/client/feature/compositor/blob_image_serialization_processor.h" | 5 #include "blimp/client/feature/compositor/blob_image_serialization_processor.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/memory/ptr_util.h" |
| 12 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 13 #include "base/sha1.h" | 14 #include "base/sha1.h" |
| 14 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
| 16 #include "blimp/client/feature/compositor/blimp_client_picture_cache.h" |
| 15 #include "blimp/client/feature/compositor/blimp_image_decoder.h" | 17 #include "blimp/client/feature/compositor/blimp_image_decoder.h" |
| 16 #include "blimp/common/blob_cache/blob_cache.h" | 18 #include "blimp/common/blob_cache/blob_cache.h" |
| 17 #include "blimp/common/blob_cache/id_util.h" | 19 #include "blimp/common/blob_cache/id_util.h" |
| 18 #include "blimp/common/proto/blob_cache.pb.h" | 20 #include "blimp/common/proto/blob_cache.pb.h" |
| 19 #include "blimp/net/blob_channel/blob_channel_receiver.h" | 21 #include "blimp/net/blob_channel/blob_channel_receiver.h" |
| 20 | 22 |
| 21 namespace blimp { | 23 namespace blimp { |
| 22 namespace client { | 24 namespace client { |
| 23 | 25 |
| 24 BlobImageSerializationProcessor* | 26 BlobImageSerializationProcessor* |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 if (!blob) { | 72 if (!blob) { |
| 71 LOG(ERROR) << "No blob found with ID: " | 73 LOG(ERROR) << "No blob found with ID: " |
| 72 << BlobIdToString(parsed_metadata.id()); | 74 << BlobIdToString(parsed_metadata.id()); |
| 73 error_delegate_->OnImageDecodeError(); | 75 error_delegate_->OnImageDecodeError(); |
| 74 return false; | 76 return false; |
| 75 } | 77 } |
| 76 | 78 |
| 77 DVLOG(1) << "GetAndDecodeBlob(" << BlobIdToString(parsed_metadata.id()) | 79 DVLOG(1) << "GetAndDecodeBlob(" << BlobIdToString(parsed_metadata.id()) |
| 78 << ")"; | 80 << ")"; |
| 79 | 81 |
| 80 return BlimpImageDecoder(reinterpret_cast<const void*>(&blob->data[0]), | 82 return DecodeBlimpImage(reinterpret_cast<const void*>(&blob->data[0]), |
| 81 blob->data.size(), bitmap); | 83 blob->data.size(), bitmap); |
| 82 } | 84 } |
| 83 | 85 |
| 84 SkPixelSerializer* BlobImageSerializationProcessor::GetPixelSerializer() { | 86 std::unique_ptr<cc::EnginePictureCache> |
| 87 BlobImageSerializationProcessor::CreateEnginePictureCache() { |
| 85 NOTREACHED(); | 88 NOTREACHED(); |
| 86 return nullptr; | 89 return nullptr; |
| 87 } | 90 } |
| 88 | 91 |
| 89 SkPicture::InstallPixelRefProc | 92 std::unique_ptr<cc::ClientPictureCache> |
| 90 BlobImageSerializationProcessor::GetPixelDeserializer() { | 93 BlobImageSerializationProcessor::CreateClientPictureCache() { |
| 91 return &BlobImageSerializationProcessor::InstallPixelRefProc; | 94 return base::WrapUnique(new BlimpClientPictureCache( |
| 95 &BlobImageSerializationProcessor::InstallPixelRefProc)); |
| 92 } | 96 } |
| 93 | 97 |
| 94 } // namespace client | 98 } // namespace client |
| 95 } // namespace blimp | 99 } // namespace blimp |
| OLD | NEW |