• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2020 The Tint Authors.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #include "src/inspector/entry_point.h"
16 
17 namespace tint {
18 namespace inspector {
19 
20 EntryPoint::EntryPoint() = default;
21 EntryPoint::EntryPoint(EntryPoint&) = default;
22 EntryPoint::EntryPoint(EntryPoint&&) = default;
23 EntryPoint::~EntryPoint() = default;
24 
ASTToInspectorInterpolationType(ast::InterpolationType ast_type)25 InterpolationType ASTToInspectorInterpolationType(
26     ast::InterpolationType ast_type) {
27   switch (ast_type) {
28     case ast::InterpolationType::kPerspective:
29       return InterpolationType::kPerspective;
30     case ast::InterpolationType::kLinear:
31       return InterpolationType::kLinear;
32     case ast::InterpolationType::kFlat:
33       return InterpolationType::kFlat;
34   }
35 
36   return InterpolationType::kUnknown;
37 }
38 
ASTToInspectorInterpolationSampling(ast::InterpolationSampling sampling)39 InterpolationSampling ASTToInspectorInterpolationSampling(
40     ast::InterpolationSampling sampling) {
41   switch (sampling) {
42     case ast::InterpolationSampling::kNone:
43       return InterpolationSampling::kNone;
44     case ast::InterpolationSampling::kCenter:
45       return InterpolationSampling::kCenter;
46     case ast::InterpolationSampling::kCentroid:
47       return InterpolationSampling::kCentroid;
48     case ast::InterpolationSampling::kSample:
49       return InterpolationSampling::kSample;
50   }
51 
52   return InterpolationSampling::kUnknown;
53 }
54 
55 }  // namespace inspector
56 }  // namespace tint
57