blob: 0be9b54ae307dd297038efcc5b9c60ee389ee719 [file] [log] [blame]
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_DISPLAY_LIST_DISPLAY_LIST_TILE_MODE_H_
#define FLUTTER_DISPLAY_LIST_DISPLAY_LIST_TILE_MODE_H_
#include "third_party/skia/include/core/SkTileMode.h"
namespace flutter {
// An enum to define how to repeat, fold, or omit colors outside of the
// typically defined range of the source of the colors (such as the
// bounds of an image or the defining geoetry of a gradient).
enum class DlTileMode {
// Replicate the edge color if the |DlColorSource| draws outside of the
// defined bounds.
kClamp,
// Repeat the |DlColorSource|'s defined colors both horizontally and
// vertically (or both along and perpendicular to a gradient's geometry).
kRepeat,
// Repeat the |DlColorSource|'s colors horizontally and vertically,
// alternating mirror images so that adjacent images always seam.
kMirror,
// Only draw within the original domain, return transparent-black everywhere
// else.
kDecal,
};
inline DlTileMode ToDl(SkTileMode sk_mode) {
return static_cast<DlTileMode>(sk_mode);
}
inline SkTileMode ToSk(DlTileMode dl_mode) {
return static_cast<SkTileMode>(dl_mode);
}
} // namespace flutter
#endif // FLUTTER_DISPLAY_LIST_DISPLAY_LIST_TILE_MODE_H_