Skip to content

Commit 84e22c1

Browse files
committed
R6 compliant through brushes.
1 parent 2cb2508 commit 84e22c1

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

N3888_RefImpl/src/xbrushes.h

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ namespace std::experimental::io2d {
3131
private:
3232
float _Offset;
3333
rgba_color _Color;
34+
friend constexpr bool operator==(const gradient_stop& lhs, const gradient_stop& rhs) noexcept;
3435
public:
3536
constexpr gradient_stop() noexcept;
3637
constexpr gradient_stop(float offset, const rgba_color& color);
@@ -40,10 +41,6 @@ namespace std::experimental::io2d {
4041

4142
constexpr float offset() const noexcept;
4243
constexpr rgba_color color() const noexcept;
43-
44-
constexpr bool operator==(const gradient_stop& rhs);
45-
46-
constexpr bool operator!=(const gradient_stop& rhs);
4744
};
4845

4946
constexpr bool operator==(const gradient_stop& lhs, const gradient_stop& rhs)
@@ -52,15 +49,13 @@ namespace std::experimental::io2d {
5249
noexcept;
5350

5451
class brush {
55-
public:
56-
typedef cairo_pattern_t* native_handle_type;
57-
58-
private:
59-
::std::shared_ptr<cairo_pattern_t> _Brush;
60-
::std::shared_ptr<image_surface> _Image_surface;
52+
shared_ptr<cairo_pattern_t> _Brush;
53+
shared_ptr<image_surface> _Image_surface;
6154
brush_type _Brush_type;
6255

6356
public:
57+
typedef cairo_pattern_t* native_handle_type;
58+
6459
native_handle_type native_handle() const noexcept;
6560

6661
explicit brush(const rgba_color& c);

N3888_RefImpl/src/xio2d_impl.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2140,12 +2140,8 @@ namespace std::experimental::io2d {
21402140
return _Color;
21412141
}
21422142

2143-
inline constexpr bool gradient_stop::operator==(const gradient_stop& rhs) {
2144-
return _Offset == rhs._Offset && _Color == rhs._Color;
2145-
}
2146-
2147-
inline constexpr bool gradient_stop::operator!=(const gradient_stop& rhs) {
2148-
return !((*this) == rhs);
2143+
inline constexpr bool operator==(const gradient_stop& lhs, const gradient_stop& rhs) noexcept {
2144+
return lhs._Offset == rhs._Offset && lhs._Color == rhs._Color;
21492145
}
21502146

21512147
template <class InputIterator>

0 commit comments

Comments
 (0)