OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkMultiPictureDocumentPriv_DEFINED | 8 #ifndef SkMultiPictureDocumentPriv_DEFINED |
9 #define SkMultiPictureDocumentPriv_DEFINED | 9 #define SkMultiPictureDocumentPriv_DEFINED |
10 | 10 |
11 #include "stdint.h" | 11 #include "SkTArray.h" |
| 12 #include "SkSize.h" |
12 | 13 |
13 namespace SkMultiPictureDocumentProtocol { | 14 namespace SkMultiPictureDocumentProtocol { |
14 static constexpr char kMagic[] = "Skia Multi-Picture Doc\n\n"; | 15 static constexpr char kMagic[] = "Skia Multi-Picture Doc\n\n"; |
15 | 16 |
16 struct Entry { | 17 static constexpr char kEndPage[] = "SkMultiPictureEndPage"; |
17 uint64_t offset; | 18 |
18 float sizeX; | 19 const uint32_t kVersion = 2; |
19 float sizeY; | 20 |
20 }; | 21 inline SkSize Join(const SkTArray<SkSize>& sizes) { |
| 22 SkSize joined = SkSize::Make(0, 0); |
| 23 for (SkSize s : sizes) { |
| 24 joined = SkSize::Make(SkTMax(joined.width(), s.width()), |
| 25 SkTMax(joined.height(), s.height())); |
| 26 } |
| 27 return joined; |
| 28 } |
| 29 |
21 } | 30 } |
22 | 31 |
23 #endif // SkMultiPictureDocumentPriv_DEFINED | 32 #endif // SkMultiPictureDocumentPriv_DEFINED |
OLD | NEW |