| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef SKIA_EXT_SKIA_UTILS_BASE_H_ | 5 #ifndef SKIA_EXT_SKIA_UTILS_BASE_H_ |
| 6 #define SKIA_EXT_SKIA_UTILS_BASE_H_ | 6 #define SKIA_EXT_SKIA_UTILS_BASE_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 9 #include <vector> |
| 10 |
| 8 #include "base/pickle.h" | 11 #include "base/pickle.h" |
| 12 #include "skia/ext/SkFutureDrawable.h" |
| 13 #include "third_party/skia/include/core/SkSurfaceProps.h" |
| 9 #include "third_party/skia/include/ports/SkFontConfigInterface.h" | 14 #include "third_party/skia/include/ports/SkFontConfigInterface.h" |
| 10 #include "third_party/skia/include/core/SkSurfaceProps.h" | |
| 11 | 15 |
| 12 namespace skia { | 16 namespace skia { |
| 13 | 17 |
| 14 // Return true if the pickle/iterator contains a string. If so, and if str | 18 // Return true if the pickle/iterator contains a string. If so, and if str |
| 15 // is not null, copy that string into str. | 19 // is not null, copy that string into str. |
| 16 SK_API bool ReadSkString(base::PickleIterator* iter, SkString* str); | 20 SK_API bool ReadSkString(base::PickleIterator* iter, SkString* str); |
| 17 | 21 |
| 18 // Return true if the pickle/iterator contains a FontIdentity. If so, and if | 22 // Return true if the pickle/iterator contains a FontIdentity. If so, and if |
| 19 // identity is not null, copy it into identity. | 23 // identity is not null, copy it into identity. |
| 20 SK_API bool ReadSkFontIdentity(base::PickleIterator* iter, | 24 SK_API bool ReadSkFontIdentity(base::PickleIterator* iter, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 31 SK_API bool WriteSkFontIdentity( | 35 SK_API bool WriteSkFontIdentity( |
| 32 base::Pickle* pickle, | 36 base::Pickle* pickle, |
| 33 const SkFontConfigInterface::FontIdentity& identity); | 37 const SkFontConfigInterface::FontIdentity& identity); |
| 34 | 38 |
| 35 // Return true if str can be written into the request pickle. | 39 // Return true if str can be written into the request pickle. |
| 36 SK_API bool WriteSkFontStyle(base::Pickle* pickle, SkFontStyle style); | 40 SK_API bool WriteSkFontStyle(base::Pickle* pickle, SkFontStyle style); |
| 37 | 41 |
| 38 // Determine the default pixel geometry (for LCD) by querying the font host | 42 // Determine the default pixel geometry (for LCD) by querying the font host |
| 39 SK_API SkPixelGeometry ComputeDefaultPixelGeometry(); | 43 SK_API SkPixelGeometry ComputeDefaultPixelGeometry(); |
| 40 | 44 |
| 45 // Create a SkDrawable from flattened data buffer. |
| 46 SK_API std::unique_ptr<SkDrawable> ReadDrawable(const char* buffer, |
| 47 size_t size); |
| 48 |
| 49 // Flatten a SkDrawable and write into a data buffer. |
| 50 SK_API std::vector<char> WriteDrawable(SkDrawable* drawable); |
| 51 |
| 41 } // namespace skia | 52 } // namespace skia |
| 42 | 53 |
| 43 #endif // SKIA_EXT_SKIA_UTILS_BASE_H_ | 54 #endif // SKIA_EXT_SKIA_UTILS_BASE_H_ |
| 44 | 55 |
| OLD | NEW |