From 7b0bef1c2691f73a2111b0d6d77bcbd1177f56ab Mon Sep 17 00:00:00 2001 From: "Michael B. McLaughlin" Date: Mon, 6 Oct 2014 17:31:22 -0400 Subject: [PATCH] Revert "Renamed surface::push_group_with_content to surface::push_group. Renamed surface::copy_clip_rectangle_list to surface::get_clip_rectangles. Added path_data validation code to path class constructor." This reverts commit 42a1981dba373fb956d5d64140fe2008be13de82. --- N3888_RefImpl/src/drawing.h | 4 ++-- N3888_RefImpl/src/path.cpp | 18 ------------------ N3888_RefImpl/src/sample_draw.cpp | 15 --------------- N3888_RefImpl/src/surface.cpp | 4 ++-- 4 files changed, 4 insertions(+), 37 deletions(-) diff --git a/N3888_RefImpl/src/drawing.h b/N3888_RefImpl/src/drawing.h index 61e6140..8119945 100644 --- a/N3888_RefImpl/src/drawing.h +++ b/N3888_RefImpl/src/drawing.h @@ -980,7 +980,7 @@ namespace std { void save(); void restore(); void push_group(); - void push_group(content c); + void push_group_with_content(content c); surface pop_group(); void pop_group_to_source(); @@ -1025,7 +1025,7 @@ namespace std { bool in_clip(const point& pt) const; void reset_clip(); - ::std::vector get_clip_rectangles() const; + ::std::vector copy_clip_rectangle_list() const; void fill(); void fill(const surface& s); diff --git a/N3888_RefImpl/src/path.cpp b/N3888_RefImpl/src/path.cpp index 49250d7..cde94ea 100644 --- a/N3888_RefImpl/src/path.cpp +++ b/N3888_RefImpl/src/path.cpp @@ -10,24 +10,6 @@ path::path(const path_builder& pb) , _Has_current_point(pb._Has_current_point) , _Current_point(pb._Current_point) , _Extents(pb.get_path_extents()) { - // Validate path data. - for (unsigned int i = 0; i < _Data.size(); i += _Data[i].header.length) { - auto pdt = _Data[i].header.type; - switch (pdt) { - case std::experimental::drawing::path_data_type::move_to: - break; - case std::experimental::drawing::path_data_type::line_to: - break; - case std::experimental::drawing::path_data_type::curve_to: - break; - case std::experimental::drawing::path_data_type::new_sub_path: - break; - case std::experimental::drawing::path_data_type::close_path: - break; - default: - throw drawing_exception(status::invalid_path_data); - } - } } path::path(path&& other) diff --git a/N3888_RefImpl/src/sample_draw.cpp b/N3888_RefImpl/src/sample_draw.cpp index 391664b..35974c9 100644 --- a/N3888_RefImpl/src/sample_draw.cpp +++ b/N3888_RefImpl/src/sample_draw.cpp @@ -113,20 +113,5 @@ void sample_draw::operator()(surface& rs, double elapsedTimeInMilliseconds) { radialPattern.set_extend(extend::reflect); rs.set_pattern(radialPattern.get_pattern()); rs.fill(); - - auto linearPattern = linear_pattern_builder({ 510.0, 460.0 }, { 530.0, 480.0 }); - linearPattern.add_color_stop_rgba(0.0, rgba_color::chartreuse); - linearPattern.add_color_stop_rgba(1.0, rgba_color::salmon); - linearPattern.set_extend(extend::repeat); - pb.reset(); - pb.set_origin({ 500.0, 450.0 }); - pb.rect({ 500.0, 450.0, 100.0, 100.0 }); - pb.rect({ 525.0, 425.0, 50.0, 150.0 }); - rs.set_path(pb.get_path()); - rs.set_pattern(redPattern); - rs.stroke(); - rs.set_pattern(linearPattern.get_pattern()); - rs.fill(); - timer = (timer > phaseTime * (phaseCount + 2)) ? 0.0 : timer + elapsedTimeInMilliseconds; } diff --git a/N3888_RefImpl/src/surface.cpp b/N3888_RefImpl/src/surface.cpp index 6f19afe..ba34805 100644 --- a/N3888_RefImpl/src/surface.cpp +++ b/N3888_RefImpl/src/surface.cpp @@ -133,7 +133,7 @@ void surface::push_group() { cairo_push_group(_Context.get()); } -void surface::push_group(content c) { +void surface::push_group_with_content(content c) { cairo_push_group_with_content(_Context.get(), _Content_to_cairo_content_t(c)); } @@ -267,7 +267,7 @@ void surface::reset_clip() { cairo_reset_clip(_Context.get()); } -vector surface::get_clip_rectangles() const { +vector surface::copy_clip_rectangle_list() const { vector results; std::unique_ptr> sp_rects(cairo_copy_clip_rectangle_list(_Context.get()), &cairo_rectangle_list_destroy); _Throw_if_failed_status(_Cairo_status_t_to_status(sp_rects->status));