Skip to content

Commit

Permalink
Revert "Renamed surface::push_group_with_content to surface::push_gro…
Browse files Browse the repository at this point in the history
…up. Renamed surface::copy_clip_rectangle_list to surface::get_clip_rectangles. Added path_data validation code to path class constructor."

This reverts commit 42a1981.
  • Loading branch information
mikebmcl committed Oct 6, 2014
1 parent 8418080 commit 7b0bef1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 37 deletions.
4 changes: 2 additions & 2 deletions N3888_RefImpl/src/drawing.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -1025,7 +1025,7 @@ namespace std {
bool in_clip(const point& pt) const;
void reset_clip();

::std::vector<rectangle> get_clip_rectangles() const;
::std::vector<rectangle> copy_clip_rectangle_list() const;

void fill();
void fill(const surface& s);
Expand Down
18 changes: 0 additions & 18 deletions N3888_RefImpl/src/path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
15 changes: 0 additions & 15 deletions N3888_RefImpl/src/sample_draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
4 changes: 2 additions & 2 deletions N3888_RefImpl/src/surface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down Expand Up @@ -267,7 +267,7 @@ void surface::reset_clip() {
cairo_reset_clip(_Context.get());
}

vector<rectangle> surface::get_clip_rectangles() const {
vector<rectangle> surface::copy_clip_rectangle_list() const {
vector<rectangle> results;
std::unique_ptr<cairo_rectangle_list_t, function<void(cairo_rectangle_list_t*)>> 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));
Expand Down

0 comments on commit 7b0bef1

Please sign in to comment.