blob: b67d3a194d04b6daceba7199a0e45f6536b9ff6b [file] [log] [blame]
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "skia/public/mojom/tile_mode.mojom-shared.h"
#include "third_party/skia/include/core/SkTileMode.h"
namespace mojo {
template <>
struct EnumTraits<skia::mojom::TileMode, SkTileMode> {
static skia::mojom::TileMode ToMojom(SkTileMode tile_mode) {
switch (tile_mode) {
case SkTileMode::kClamp:
return skia::mojom::TileMode::CLAMP;
case SkTileMode::kRepeat:
return skia::mojom::TileMode::REPEAT;
case SkTileMode::kMirror:
return skia::mojom::TileMode::MIRROR;
case SkTileMode::kDecal:
return skia::mojom::TileMode::DECAL;
return skia::mojom::TileMode::DECAL;
static bool FromMojom(skia::mojom::TileMode input, SkTileMode* out) {
switch (input) {
case skia::mojom::TileMode::CLAMP:
*out = SkTileMode::kClamp;
return true;
case skia::mojom::TileMode::REPEAT:
*out = SkTileMode::kRepeat;
return true;
case skia::mojom::TileMode::MIRROR:
*out = SkTileMode::kMirror;
return true;
case skia::mojom::TileMode::DECAL:
*out = SkTileMode::kDecal;
return true;
return false;
} // namespace mojo