reed | 4a8126e | 2014-09-22 07:29:03 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2014 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 SkSurfacePriv_DEFINED |
| 9 | #define SkSurfacePriv_DEFINED |
| 10 | |
| 11 | #include "SkSurfaceProps.h" |
| 12 | |
Florin Malita | f40b249 | 2017-05-03 15:23:21 -0400 | [diff] [blame] | 13 | struct SkImageInfo; |
| 14 | |
reed | 4a8126e | 2014-09-22 07:29:03 -0700 | [diff] [blame] | 15 | static inline SkSurfaceProps SkSurfacePropsCopyOrDefault(const SkSurfaceProps* props) { |
| 16 | if (props) { |
| 17 | return *props; |
| 18 | } else { |
| 19 | return SkSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType); |
| 20 | } |
| 21 | } |
| 22 | |
Florin Malita | f40b249 | 2017-05-03 15:23:21 -0400 | [diff] [blame] | 23 | constexpr size_t kIgnoreRowBytesValue = static_cast<size_t>(~0); |
| 24 | |
| 25 | bool SkSurfaceValidateRasterInfo(const SkImageInfo&, size_t rb = kIgnoreRowBytesValue); |
| 26 | |
reed | 4a8126e | 2014-09-22 07:29:03 -0700 | [diff] [blame] | 27 | #endif |