Skip to content

Commit e00e044

Browse files
committed
R6 - image_surface::map implementation issue resolved
1 parent 1625fad commit e00e044

File tree

2 files changed

+1
-31
lines changed

2 files changed

+1
-31
lines changed

N3888_RefImpl/src/image_surface.cpp

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -703,8 +703,6 @@ void image_surface::save(string f, image_file_format idf) {
703703
}
704704
}
705705

706-
// make friendship decision
707-
/*
708706
void image_surface::map(const ::std::function<void(mapped_surface&)>& action) {
709707
if (action != nullptr) {
710708
mapped_surface m({ cairo_surface_map_to_image(_Surface.get(), nullptr), nullptr }, { _Surface.get(), nullptr });
@@ -727,35 +725,7 @@ void image_surface::map(const ::std::function<void(mapped_surface&, error_code&)
727725
}
728726
ec.clear();
729727
}
730-
*/
731728

732-
// divergent from paper
733-
/*
734-
void image_surface::map(const ::std::function<void(mapped_surface&)>& action, const bounding_box& extents) {
735-
if (action != nullptr) {
736-
cairo_rectangle_int_t cextents{ _Double_to_int(extents.x()), _Double_to_int(extents.y()), _Double_to_int(extents.width()), _Double_to_int(extents.height()) };
737-
mapped_surface m({ cairo_surface_map_to_image(_Surface.get(), &cextents), nullptr }, { _Surface.get(), nullptr });
738-
action(m);
739-
}
740-
mark_dirty(extents);
741-
}
742-
743-
void image_surface::map(const ::std::function<void(mapped_surface&, error_code&)>& action, const bounding_box& extents, error_code& ec) {
744-
if (action != nullptr) {
745-
cairo_rectangle_int_t cextents{ _Double_to_int(extents.x()), _Double_to_int(extents.y()), _Double_to_int(extents.width()), _Double_to_int(extents.height()) };
746-
mapped_surface m({ cairo_surface_map_to_image(_Surface.get(), &cextents), nullptr }, { _Surface.get(), nullptr }, ec);
747-
if (static_cast<bool>(ec)) {
748-
return;
749-
}
750-
action(m, ec);
751-
if (static_cast<bool>(ec)) {
752-
return;
753-
}
754-
mark_dirty(extents);
755-
}
756-
ec.clear();
757-
}
758-
*/
759729
format image_surface::format() const noexcept {
760730
return _Cairo_format_t_to_format(cairo_image_surface_get_format(_Surface.get()));
761731
}

N3888_RefImpl/src/xsurfaces.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ namespace std::experimental::io2d {
438438
surface::native_handle_type _Mapped_surface;
439439
surface::native_handle_type _Map_of;
440440

441-
friend surface;
441+
friend image_surface;
442442
mapped_surface(surface::native_handle_type nh, surface::native_handle_type map_of);
443443
mapped_surface(surface::native_handle_type nh, surface::native_handle_type map_of, ::std::error_code& ec) noexcept;
444444

0 commit comments

Comments
 (0)