Skip to content

Commit 8cdff23

Browse files
committed
Implemented image_surface ctor that loads an image and image_surface::save to the extent I intend to (I'm not implementing it for the a1 format since that's going away in R5, and the a8 format is not supported for JPG files because JPGs have no alpha). Prepared the way for bgra_color supporting int values in the ctor but that is R5. Added some images I created which can be used for testing the image file functionality. Made some changes to prepare for the X11 test, but I need to compile in that environment to find all the bugs and make sure everything works.
1 parent c2e7532 commit 8cdff23

File tree

11 files changed

+464
-209
lines changed

11 files changed

+464
-209
lines changed

N3888_RefImpl/src/2016_06_22.png

1.25 MB
Loading

N3888_RefImpl/src/2017_03_05.jpg

287 KB
Loading

N3888_RefImpl/src/Makefile.am

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,20 @@
11
## Process this file with automake to produce Makefile.in
22

3-
##resource_Files = @DOLLAR_SIGN@(shell glib-compile-resources --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/refimpl.gresource.xml)
4-
##refimpl-resources.c: refimpl.gresource.xml $(resource_Files)
5-
## glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-source --c-name refimpl $(srcdir)/refimpl.gresource.xml
6-
##refimpl-resources.h: refimpl.gresource.xml $(resource_Files)
7-
## glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-header --c-name refimpl $(srcdir)/refimpl.gresource.xml
8-
9-
##BUILT_SOURCES = refimpl-resources.c \
10-
## refimpl-resources.h \
11-
## $(NULL)
12-
133
bin_PROGRAMS = N3888_RefImpl
144

155
N3888_RefImpl_SOURCES = brush.cpp \
166
color_stop.cpp \
177
device.cpp \
188
display_surface-common.cpp \
199
entrypoint.cpp \
20-
font_extents.cpp \
21-
font_options.cpp \
22-
font_resource.cpp \
23-
font_resource_factory.cpp \
24-
glyph_run.cpp \
2510
image_surface.cpp \
2611
io2d_error_category.cpp \
27-
linear_brush_factory.cpp \
2812
mapped_surface.cpp \
2913
matrix_2d.cpp \
30-
path.cpp \
31-
path_data.cpp \
32-
radial_brush_factory.cpp \
33-
rectangle.cpp \
3414
rgba_color.cpp \
3515
sample_draw.cpp \
36-
solid_color_brush_factory.cpp \
3716
standalone_functions.cpp \
3817
surface.cpp \
39-
surface_brush_factory.cpp \
4018
test_renderer_fill.cpp \
4119
vector_2d.cpp
4220

N3888_RefImpl/src/N3888_RefImpl.vcxproj

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,10 @@
165165
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
166166
</Link>
167167
<PostBuildEvent>
168-
<Command>
169-
</Command>
168+
<Command>copy "$(ProjectDir)2016_06_22.png" "$(OutputPath)"
169+
copy "$(ProjectDir)2017_03_05.jpg" "$(OutputPath)"
170+
copy "$(ProjectDir)alpha8.png" "$(OutputPath)"
171+
</Command>
170172
</PostBuildEvent>
171173
<Bscmake>
172174
<PreserveSbr>true</PreserveSbr>
@@ -196,8 +198,10 @@
196198
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
197199
</Link>
198200
<PostBuildEvent>
199-
<Command>
200-
</Command>
201+
<Command>copy "$(ProjectDir)2016_06_22.png" "$(OutputPath)"
202+
copy "$(ProjectDir)2017_03_05.jpg" "$(OutputPath)"
203+
copy "$(ProjectDir)alpha8.png" "$(OutputPath)"
204+
</Command>
201205
</PostBuildEvent>
202206
</ItemDefinitionGroup>
203207
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@@ -219,8 +223,10 @@
219223
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
220224
</Link>
221225
<PostBuildEvent>
222-
<Command>
223-
</Command>
226+
<Command>copy "$(ProjectDir)2016_06_22.png" "$(OutputPath)"
227+
copy "$(ProjectDir)2017_03_05.jpg" "$(OutputPath)"
228+
copy "$(ProjectDir)alpha8.png" "$(OutputPath)"
229+
</Command>
224230
</PostBuildEvent>
225231
<Manifest>
226232
<EnableDpiAwareness>true</EnableDpiAwareness>
@@ -246,8 +252,10 @@
246252
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
247253
</Link>
248254
<PostBuildEvent>
249-
<Command>
250-
</Command>
255+
<Command>copy "$(ProjectDir)2016_06_22.png" "$(OutputPath)"
256+
copy "$(ProjectDir)2017_03_05.jpg" "$(OutputPath)"
257+
copy "$(ProjectDir)alpha8.png" "$(OutputPath)"
258+
</Command>
251259
</PostBuildEvent>
252260
</ItemDefinitionGroup>
253261
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -274,8 +282,10 @@
274282
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
275283
</Link>
276284
<PostBuildEvent>
277-
<Command>
278-
</Command>
285+
<Command>copy "$(ProjectDir)2016_06_22.png" "$(OutputPath)"
286+
copy "$(ProjectDir)2017_03_05.jpg" "$(OutputPath)"
287+
copy "$(ProjectDir)alpha8.png" "$(OutputPath)"
288+
</Command>
279289
</PostBuildEvent>
280290
<Manifest>
281291
<EnableDpiAwareness>true</EnableDpiAwareness>
@@ -306,8 +316,10 @@
306316
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
307317
</Link>
308318
<PostBuildEvent>
309-
<Command>
310-
</Command>
319+
<Command>copy "$(ProjectDir)2016_06_22.png" "$(OutputPath)"
320+
copy "$(ProjectDir)2017_03_05.jpg" "$(OutputPath)"
321+
copy "$(ProjectDir)alpha8.png" "$(OutputPath)"
322+
</Command>
311323
</PostBuildEvent>
312324
</ItemDefinitionGroup>
313325
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -334,8 +346,10 @@
334346
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
335347
</Link>
336348
<PostBuildEvent>
337-
<Command>
338-
</Command>
349+
<Command>copy "$(ProjectDir)2016_06_22.png" "$(OutputPath)"
350+
copy "$(ProjectDir)2017_03_05.jpg" "$(OutputPath)"
351+
copy "$(ProjectDir)alpha8.png" "$(OutputPath)"
352+
</Command>
339353
</PostBuildEvent>
340354
<Manifest>
341355
<EnableDpiAwareness>true</EnableDpiAwareness>
@@ -366,8 +380,10 @@
366380
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
367381
</Link>
368382
<PostBuildEvent>
369-
<Command>
370-
</Command>
383+
<Command>copy "$(ProjectDir)2016_06_22.png" "$(OutputPath)"
384+
copy "$(ProjectDir)2017_03_05.jpg" "$(OutputPath)"
385+
copy "$(ProjectDir)alpha8.png" "$(OutputPath)"
386+
</Command>
371387
</PostBuildEvent>
372388
</ItemDefinitionGroup>
373389
<ItemGroup>
@@ -408,6 +424,9 @@
408424
<ResourceCompile Include="N3888_RefImpl.rc" />
409425
</ItemGroup>
410426
<ItemGroup>
427+
<Image Include="2016_06_22.png" />
428+
<Image Include="2017_03_05.jpg" />
429+
<Image Include="alpha8.png" />
411430
<Image Include="N3888_RefImpl.ico" />
412431
<Image Include="small.ico" />
413432
</ItemGroup>

N3888_RefImpl/src/N3888_RefImpl.vcxproj.filters

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,15 @@
111111
<Image Include="N3888_RefImpl.ico">
112112
<Filter>Resource Files</Filter>
113113
</Image>
114+
<Image Include="2016_06_22.png">
115+
<Filter>Resource Files</Filter>
116+
</Image>
117+
<Image Include="alpha8.png">
118+
<Filter>Resource Files</Filter>
119+
</Image>
120+
<Image Include="2017_03_05.jpg">
121+
<Filter>Resource Files</Filter>
122+
</Image>
114123
</ItemGroup>
115124
<ItemGroup>
116125
<Text Include="win32\Dependency installation instructions.txt" />

N3888_RefImpl/src/alpha8.png

114 KB
Loading

N3888_RefImpl/src/display_surface-xcb.cpp

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -15,68 +15,6 @@ display_surface::native_handle_type display_surface::native_handle() const {
1515
return{ { _Surface.get(), _Context.get() }, { _Native_surface.get(), _Native_context.get() }, _Connection.get(), _Connection_mutex, _Connection_ref_count, _Screen, _Wndw };
1616
}
1717

18-
//display_surface::display_surface(display_surface&& other) noexcept
19-
// : surface(move(other))
20-
// , _Default_brush(move(other._Default_brush))
21-
// , _Display_width(move(other._Display_width))
22-
// , _Display_height(move(other._Display_height))
23-
// , _Scaling(move(other._Scaling))
24-
// , _Width(move(other._Width))
25-
// , _Height(move(other._Height))
26-
// , _Draw_fn(move(other._Draw_fn))
27-
// , _Size_change_fn(move(other._Size_change_fn))
28-
// , _User_scaling_fn(move(other._User_scaling_fn))
29-
// , _Letterbox_brush(move(other._Letterbox_brush))
30-
// , _Auto_clear(move(other._Auto_clear))
31-
// , _Screen(move(other._Screen))
32-
// , _Wndw(move(other._Wndw))
33-
// , _Can_draw(move(other._Can_draw))
34-
// , _Refresh_rate(move(other._Refresh_rate))
35-
// , _Desired_frame_rate(move(other._Desired_frame_rate))
36-
// , _Redraw_requested(other._Redraw_requested.load())
37-
// , _Elapsed_draw_time(move(other._Elapsed_draw_time))
38-
// , _Native_surface(move(other._Native_surface))
39-
// , _Native_context(move(other._Native_context)) {
40-
// other._Draw_fn = nullptr;
41-
// other._Size_change_fn = nullptr;
42-
// other._Screen = nullptr;
43-
// other._Wndw = 0;
44-
//}
45-
//
46-
//display_surface& display_surface::operator=(display_surface&& other) noexcept {
47-
// if (this != &other) {
48-
// surface::operator=(move(other));
49-
// _Default_brush = move(other._Default_brush);
50-
// _Display_width = move(other._Display_width);
51-
// _Display_height = move(other._Display_height);
52-
// _Scaling = move(other._Scaling);
53-
// _Width = move(other._Width);
54-
// _Height = move(other._Height);
55-
// _Draw_fn = move(other._Draw_fn);
56-
// _Size_change_fn = move(other._Size_change_fn);
57-
// _User_scaling_fn = move(other._User_scaling_fn);
58-
// _Letterbox_brush = move(other._Letterbox_brush);
59-
// _Auto_clear = move(other._Auto_clear);
60-
// _Screen = move(other._Screen);
61-
// _Wndw = move(other._Wndw);
62-
// _Can_draw = move(other._Can_draw);
63-
// _Refresh_rate = move(other._Refresh_rate);
64-
// _Desired_frame_rate = move(other._Desired_frame_rate);
65-
// _Redraw_requested = other._Redraw_requested.load();
66-
// _Elapsed_draw_time = move(other._Elapsed_draw_time);
67-
// _Native_surface = move(other._Native_surface);
68-
// _Native_context = move(other._Native_context);
69-
//
70-
// other._Screen = nullptr;
71-
// other._Wndw = 0;
72-
// other._Draw_fn = nullptr;
73-
// other._Size_change_fn = nullptr;
74-
// other._Can_draw = false;
75-
// }
76-
//
77-
// return *this;
78-
//}
79-
//
8018
mutex display_surface::_Connection_mutex;
8119
unique_ptr<xcb_connection_t, decltype(&xcb_disconnect)> display_surface::_Connection{ nullptr, &xcb_disconnect };
8220
int display_surface::_Connection_ref_count = 0;

0 commit comments

Comments
 (0)