OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include <algorithm> |
| 6 |
| 7 #include "ui/gfx/mojo/icc_profile_struct_traits.h" |
| 8 |
| 9 namespace mojo { |
| 10 |
| 11 // static |
| 12 bool StructTraits<gfx::mojom::ICCProfileDataView, gfx::ICCProfile>::Read( |
| 13 gfx::mojom::ICCProfileDataView data, |
| 14 gfx::ICCProfile* out) { |
| 15 out->valid_ = data.valid(); |
| 16 out->id_ = data.id(); |
| 17 |
| 18 std::vector<int8_t> bytes; |
| 19 if (!data.ReadData(&bytes)) |
| 20 return false; |
| 21 |
| 22 std::copy(bytes.begin(), bytes.end(), out->data_.begin()); |
| 23 return true; |
| 24 } |
| 25 |
| 26 } // namespace mojo |
OLD | NEW |