Mir

Merge lp:~vanvugt/mir/typo-is-not-an-example into lp:mir

Proposed by Daniel van Vugt
Status: Merged
Approved by: Daniel van Vugt
Approved revision: no longer in the source branch.
Merged at revision: 3749
Proposed branch: lp:~vanvugt/mir/typo-is-not-an-example
Merge into: lp:mir
Diff against target: 170 lines (+24/-24)
8 files modified
playground/demo-shell/typo/typo_freetype_renderer.cpp (+1/-1)
playground/demo-shell/typo/typo_freetype_renderer.h (+5/-5)
playground/demo-shell/typo/typo_glcache.cpp (+1/-1)
playground/demo-shell/typo/typo_glcache.h (+5/-5)
playground/demo-shell/typo/typo_renderer.cpp (+1/-1)
playground/demo-shell/typo/typo_renderer.h (+5/-5)
playground/demo-shell/typo/typo_stub_renderer.cpp (+1/-1)
playground/demo-shell/typo/typo_stub_renderer.h (+5/-5)
To merge this branch: bzr merge lp:~vanvugt/mir/typo-is-not-an-example
Reviewer Review Type Date Requested Status
Mir CI Bot continuous-integration Approve
Alan Griffiths Needs Fixing
Cemil Azizoglu (community) Approve
Review via email: mp+307910@code.launchpad.net

Commit message

Rename namespace mir::examples::typo -> mir::typo

Because it's not an example. In fact, libtypo is designed to not depend
on Mir-anything at all. It could even become an external project later
(with a different name, because the current one is not unique enough).

To post a comment you must log in.
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3745
https://mir-jenkins.ubuntu.com/job/mir-ci/1909/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/2424
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/2487
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2479
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2479
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2479
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/2453
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/2453/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2453
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2453/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2453
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2453/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/2453
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/2453/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2453
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2453/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2453
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2453/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/1909/rebuild

review: Approve (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

I don't have any problem with moving or publishing this functionality, but I don't find the interface particularly attractive. Could we first tidy that up?

review: Needs Information
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> I don't have any problem with moving or publishing this functionality, but I
> don't find the interface particularly attractive. Could we first tidy that up?

I mean stuff like: Renderer::Image having public data and being copyable. Both of which make it easy to get undefined behaviour.

Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :

This is not publishing it so ok by me. Perhaps Alan's comments apply to the other branch.

review: Approve
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Sounds like something that's easy to fix in a separate independent branch...

Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
https://mir-jenkins.ubuntu.com/job/mir-autolanding/665/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/2446/console
    None: https://mir-jenkins.ubuntu.com/job/generic-land-mp/706/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/2509
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2501
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2501
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2501
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/2475/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2475
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2475/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2475/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/2475
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/2475/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2475
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2475/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2475
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2475/artifact/output/*zip*/output.zip

review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

^^^
Archive sync problems again.

03:48:43 W: No sandbox user '_apt' on the system, can not drop privileges
03:48:43 E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/g/gcc-6/libobjc4_6.2.0-5ubuntu11_amd64.deb 404 Not Found [IP: 91.189.92.201 80]
03:48:43 E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/g/gcc-6/libobjc-6-dev_6.2.0-5ubuntu11_amd64.deb 404 Not Found [IP: 91.189.92.201 80]
03:48:43 E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Alan:
I see what you mean although differ in opinion. I personally tend toward the simpler (less idiotproof) code than strengthening it, given that Image is implicitly for internal use only. External users go through GLCache instead and never deal with Image. But here tis:
  https://code.launchpad.net/~vanvugt/mir/safer-typo-image/+merge/308020

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> This is not publishing it so ok by me. Perhaps Alan's comments apply to the
> other branch.

"example" at least allows the inference this isn't production quality code. I'd prefer it cleaned up before we start that process.

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> > This is not publishing it so ok by me. Perhaps Alan's comments apply to the
> > other branch.
>
> "example" at least allows the inference this isn't production quality code.
> I'd prefer it cleaned up before we start that process.

review: Needs Fixing
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

That comment is irrationally passive aggressive. You're saying that a library that's never had any bugs is "not production quality" just because you don't like the style.

Although I did the clean up you requested, to me it feels much less clean.

Revision history for this message
Mir CI Bot (mir-ci-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'playground/demo-shell/typo/typo_freetype_renderer.cpp'
2--- playground/demo-shell/typo/typo_freetype_renderer.cpp 2015-02-27 03:22:32 +0000
3+++ playground/demo-shell/typo/typo_freetype_renderer.cpp 2016-10-07 07:26:22 +0000
4@@ -20,7 +20,7 @@
5 #include <stdexcept>
6 #include <cstring>
7
8-using namespace mir::examples::typo;
9+using namespace mir::typo;
10
11 FreetypeRenderer::FreetypeRenderer()
12 : lib(nullptr), face(nullptr), preferred_height(16)
13
14=== modified file 'playground/demo-shell/typo/typo_freetype_renderer.h'
15--- playground/demo-shell/typo/typo_freetype_renderer.h 2015-02-20 06:24:57 +0000
16+++ playground/demo-shell/typo/typo_freetype_renderer.h 2016-10-07 07:26:22 +0000
17@@ -16,14 +16,14 @@
18 * Authored by: Daniel van Vugt <daniel.van.vugt@canonical.com>
19 */
20
21-#ifndef MIR_EXAMPLES_TYPO_FREETYPE_RENDERER_H_
22-#define MIR_EXAMPLES_TYPO_FREETYPE_RENDERER_H_
23+#ifndef MIR_TYPO_FREETYPE_RENDERER_H_
24+#define MIR_TYPO_FREETYPE_RENDERER_H_
25
26 #include "typo_renderer.h"
27 #include <ft2build.h>
28 #include FT_FREETYPE_H
29
30-namespace mir { namespace examples { namespace typo {
31+namespace mir { namespace typo {
32
33 class FreetypeRenderer : public Renderer
34 {
35@@ -39,6 +39,6 @@
36 int preferred_height;
37 };
38
39-} } } // namespace mir::examples::typo
40+} } // namespace mir::typo
41
42-#endif // MIR_EXAMPLES_TYPO_FREETYPE_RENDERER_H_
43+#endif // MIR_TYPO_FREETYPE_RENDERER_H_
44
45=== modified file 'playground/demo-shell/typo/typo_glcache.cpp'
46--- playground/demo-shell/typo/typo_glcache.cpp 2016-05-13 08:03:23 +0000
47+++ playground/demo-shell/typo/typo_glcache.cpp 2016-10-07 07:26:22 +0000
48@@ -19,7 +19,7 @@
49 #include "typo_glcache.h"
50 #include MIR_SERVER_GL_H
51
52-using namespace mir::examples::typo;
53+using namespace mir::typo;
54
55 GLCache::GLCache(std::shared_ptr<Renderer> const& r)
56 : renderer(r)
57
58=== modified file 'playground/demo-shell/typo/typo_glcache.h'
59--- playground/demo-shell/typo/typo_glcache.h 2015-02-20 06:24:57 +0000
60+++ playground/demo-shell/typo/typo_glcache.h 2016-10-07 07:26:22 +0000
61@@ -16,15 +16,15 @@
62 * Authored by: Daniel van Vugt <daniel.van.vugt@canonical.com>
63 */
64
65-#ifndef MIR_EXAMPLES_TYPO_GLCACHE_H_
66-#define MIR_EXAMPLES_TYPO_GLCACHE_H_
67+#ifndef MIR_TYPO_GLCACHE_H_
68+#define MIR_TYPO_GLCACHE_H_
69
70 #include "typo_renderer.h"
71 #include <string>
72 #include <unordered_map>
73 #include <memory>
74
75-namespace mir { namespace examples { namespace typo {
76+namespace mir { namespace typo {
77
78 class GLCache
79 {
80@@ -51,6 +51,6 @@
81 std::shared_ptr<Renderer> renderer;
82 };
83
84-} } } // namespace mir::examples::typo
85+} } // namespace mir::typo
86
87-#endif // MIR_EXAMPLES_TYPO_GLCACHE_H_
88+#endif // MIR_TYPO_GLCACHE_H_
89
90=== modified file 'playground/demo-shell/typo/typo_renderer.cpp'
91--- playground/demo-shell/typo/typo_renderer.cpp 2015-02-19 09:30:02 +0000
92+++ playground/demo-shell/typo/typo_renderer.cpp 2016-10-07 07:26:22 +0000
93@@ -19,7 +19,7 @@
94 #include "typo_renderer.h"
95 #include <cstring>
96
97-using namespace mir::examples::typo;
98+using namespace mir::typo;
99
100 Renderer::Image::Image()
101 : buf(nullptr), width(0), stride(0), height(0), align(4), format(alpha8)
102
103=== modified file 'playground/demo-shell/typo/typo_renderer.h'
104--- playground/demo-shell/typo/typo_renderer.h 2015-02-20 06:24:57 +0000
105+++ playground/demo-shell/typo/typo_renderer.h 2016-10-07 07:26:22 +0000
106@@ -16,10 +16,10 @@
107 * Authored by: Daniel van Vugt <daniel.van.vugt@canonical.com>
108 */
109
110-#ifndef MIR_EXAMPLES_TYPO_RENDERER_H_
111-#define MIR_EXAMPLES_TYPO_RENDERER_H_
112+#ifndef MIR_TYPO_RENDERER_H_
113+#define MIR_TYPO_RENDERER_H_
114
115-namespace mir { namespace examples { namespace typo {
116+namespace mir { namespace typo {
117
118 class Renderer
119 {
120@@ -42,6 +42,6 @@
121 static unsigned long unicode_from_utf8(char const** utf8);
122 };
123
124-} } } // namespace mir::examples::typo
125+} } // namespace mir::typo
126
127-#endif // MIR_EXAMPLES_TYPO_RENDERER_H_
128+#endif // MIR_TYPO_RENDERER_H_
129
130=== modified file 'playground/demo-shell/typo/typo_stub_renderer.cpp'
131--- playground/demo-shell/typo/typo_stub_renderer.cpp 2015-02-19 09:12:04 +0000
132+++ playground/demo-shell/typo/typo_stub_renderer.cpp 2016-10-07 07:26:22 +0000
133@@ -19,7 +19,7 @@
134 #include "typo_stub_renderer.h"
135 #include <cstring>
136
137-using namespace mir::examples::typo;
138+using namespace mir::typo;
139
140 void StubRenderer::render(char const* str, Image& img)
141 {
142
143=== modified file 'playground/demo-shell/typo/typo_stub_renderer.h'
144--- playground/demo-shell/typo/typo_stub_renderer.h 2015-02-20 06:24:57 +0000
145+++ playground/demo-shell/typo/typo_stub_renderer.h 2016-10-07 07:26:22 +0000
146@@ -16,12 +16,12 @@
147 * Authored by: Daniel van Vugt <daniel.van.vugt@canonical.com>
148 */
149
150-#ifndef MIR_EXAMPLES_TYPO_STUB_RENDERER_H_
151-#define MIR_EXAMPLES_TYPO_STUB_RENDERER_H_
152+#ifndef MIR_TYPO_STUB_RENDERER_H_
153+#define MIR_TYPO_STUB_RENDERER_H_
154
155 #include "typo_renderer.h"
156
157-namespace mir { namespace examples { namespace typo {
158+namespace mir { namespace typo {
159
160 class StubRenderer : public Renderer
161 {
162@@ -29,6 +29,6 @@
163 void render(char const* str, Image& img) override;
164 };
165
166-} } } // namespace mir::examples::typo
167+} } // namespace mir::typo
168
169-#endif // MIR_EXAMPLES_TYPO_STUB_RENDERER_H_
170+#endif // MIR_TYPO_STUB_RENDERER_H_

Subscribers

People subscribed via source and target branches