forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add mixed type specializations on algebraic ops in TPoint (#21)
Also adds missing RHS operator overloads for TSize. For any algebraic ops involving TPoint and TSize: 1. `TPoint` takes precedent over `TSize`. 2. Floating point types take precedent over integer types. 3. If there's a tie (for example: `TPoint<int> + TPoint<long long>`), the LHS takes precedent.
- Loading branch information
Showing
5 changed files
with
272 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// 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. | ||
|
||
#include "type_traits.h" | ||
|
||
namespace impeller { | ||
|
||
// | ||
|
||
} // namespace impeller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// 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. | ||
|
||
#pragma once | ||
|
||
#include <type_traits> | ||
|
||
namespace impeller { | ||
|
||
template <class F, | ||
class I, | ||
class = std::enable_if_t<std::is_floating_point_v<F> && | ||
std::is_integral_v<I>>> | ||
struct MixedOp_ : public std::true_type {}; | ||
|
||
template <class F, class I> | ||
using MixedOp = typename MixedOp_<F, I>::type; | ||
|
||
} // namespace impeller |