| 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 "base/pickle.h" | 8 #include "base/pickle.h" |
| 9 #include "third_party/skia/include/core/SkImage.h" |
| 10 #include "third_party/skia/include/core/SkSurfaceProps.h" |
| 9 #include "third_party/skia/include/ports/SkFontConfigInterface.h" | 11 #include "third_party/skia/include/ports/SkFontConfigInterface.h" |
| 10 #include "third_party/skia/include/core/SkSurfaceProps.h" | |
| 11 | 12 |
| 12 namespace skia { | 13 namespace skia { |
| 13 | 14 |
| 14 // Return true if the pickle/iterator contains a string. If so, and if str | 15 // Return true if the pickle/iterator contains a string. If so, and if str |
| 15 // is not null, copy that string into str. | 16 // is not null, copy that string into str. |
| 16 SK_API bool ReadSkString(base::PickleIterator* iter, SkString* str); | 17 SK_API bool ReadSkString(base::PickleIterator* iter, SkString* str); |
| 17 | 18 |
| 18 // Return true if the pickle/iterator contains a FontIdentity. If so, and if | 19 // Return true if the pickle/iterator contains a FontIdentity. If so, and if |
| 19 // identity is not null, copy it into identity. | 20 // identity is not null, copy it into identity. |
| 20 SK_API bool ReadSkFontIdentity(base::PickleIterator* iter, | 21 SK_API bool ReadSkFontIdentity(base::PickleIterator* iter, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 31 SK_API bool WriteSkFontIdentity( | 32 SK_API bool WriteSkFontIdentity( |
| 32 base::Pickle* pickle, | 33 base::Pickle* pickle, |
| 33 const SkFontConfigInterface::FontIdentity& identity); | 34 const SkFontConfigInterface::FontIdentity& identity); |
| 34 | 35 |
| 35 // Return true if str can be written into the request pickle. | 36 // Return true if str can be written into the request pickle. |
| 36 SK_API bool WriteSkFontStyle(base::Pickle* pickle, SkFontStyle style); | 37 SK_API bool WriteSkFontStyle(base::Pickle* pickle, SkFontStyle style); |
| 37 | 38 |
| 38 // Determine the default pixel geometry (for LCD) by querying the font host | 39 // Determine the default pixel geometry (for LCD) by querying the font host |
| 39 SK_API SkPixelGeometry ComputeDefaultPixelGeometry(); | 40 SK_API SkPixelGeometry ComputeDefaultPixelGeometry(); |
| 40 | 41 |
| 42 // Uses safe math to compute and return the size of |image|. |
| 43 SK_API size_t SafeSizeOfImage(const SkImage* image); |
| 44 |
| 41 } // namespace skia | 45 } // namespace skia |
| 42 | 46 |
| 43 #endif // SKIA_EXT_SKIA_UTILS_BASE_H_ | 47 #endif // SKIA_EXT_SKIA_UTILS_BASE_H_ |
| 44 | 48 |
| OLD | NEW |