halcanary | 45420a9 | 2016-06-02 12:41:14 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #ifndef SkMultiPictureDocumentPriv_DEFINED |
| 9 | #define SkMultiPictureDocumentPriv_DEFINED |
| 10 | |
halcanary | c966ef9 | 2016-08-23 09:15:04 -0700 | [diff] [blame^] | 11 | #include "SkTArray.h" |
| 12 | #include "SkSize.h" |
halcanary | 45420a9 | 2016-06-02 12:41:14 -0700 | [diff] [blame] | 13 | |
| 14 | namespace SkMultiPictureDocumentProtocol { |
| 15 | static constexpr char kMagic[] = "Skia Multi-Picture Doc\n\n"; |
| 16 | |
halcanary | c966ef9 | 2016-08-23 09:15:04 -0700 | [diff] [blame^] | 17 | static constexpr char kEndPage[] = "SkMultiPictureEndPage"; |
| 18 | |
| 19 | const uint32_t kVersion = 2; |
| 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 | |
halcanary | 45420a9 | 2016-06-02 12:41:14 -0700 | [diff] [blame] | 30 | } |
| 31 | |
| 32 | #endif // SkMultiPictureDocumentPriv_DEFINED |