Merge lp:~thumper/unity/revert-r2960 into lp:unity

Proposed by Tim Penhey
Status: Merged
Approved by: Christopher Lee
Approved revision: no longer in the source branch.
Merged at revision: 2963
Proposed branch: lp:~thumper/unity/revert-r2960
Merge into: lp:unity
Diff against target: 89 lines (+12/-46)
2 files modified
tests/test_static_cairo_text.cpp (+6/-31)
unity-shared/StaticCairoText.cpp (+6/-15)
To merge this branch: bzr merge lp:~thumper/unity/revert-r2960
Reviewer Review Type Date Requested Status
Christopher Lee (community) Approve
PS Jenkins bot continuous-integration Pending
Review via email: mp+138896@code.launchpad.net

Commit message

Revert r2960 which broke tooltip rendering.

Description of the change

r2960 broke the rendering of tooltips.

This branch is just a reverse merge of r2960. When the changes in that branch have been updated and no longer breaks tooltips, we can look to merge the changes again.

To post a comment you must log in.
Revision history for this message
Christopher Lee (veebers) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/test_static_cairo_text.cpp'
2--- tests/test_static_cairo_text.cpp 2012-12-05 13:11:28 +0000
3+++ tests/test_static_cairo_text.cpp 2012-12-10 00:35:27 +0000
4@@ -33,29 +33,17 @@
5 class MockStaticCairoText : public nux::StaticCairoText
6 {
7 public:
8- MOCK_METHOD2(SetBaseSize, void(int, int));
9-
10 MockStaticCairoText():StaticCairoText("") {}
11
12 using StaticCairoText::GetTextureStartIndices;
13 using StaticCairoText::GetTextureEndIndices;
14- using StaticCairoText::PreLayoutManagement;
15-};
16-
17-class TestStaticCairoText : public ::testing::Test
18-{
19- protected:
20- TestStaticCairoText() : Test()
21- {
22- text = new MockStaticCairoText();
23- }
24- nux::ObjectPtr<MockStaticCairoText> text;
25-};
26-
27-TEST_F(TestStaticCairoText, TextTextureSize)
28-{
29- EXPECT_CALL(*text.GetPointer(), SetBaseSize(_, _)).Times(AnyNumber());
30+};
31+
32+TEST(TestStaticCairoText, TextTextureSize)
33+{
34 // Test multi-texture stitching support.
35+
36+ nux::ObjectPtr<MockStaticCairoText> text(new MockStaticCairoText());
37 text->SetLines(-2000);
38 text->SetMaximumWidth(100);
39
40@@ -82,17 +70,4 @@
41 }
42 }
43
44-TEST_F(TestStaticCairoText, TextPreLayoutManagementMultipleCalls)
45-{
46- EXPECT_CALL(*text.GetPointer(), SetBaseSize(_, _)).Times(2);
47-
48- text->PreLayoutManagement();
49-
50- // the first prelayout methods should have called set base size and therefore
51- // we should not call it again
52- EXPECT_CALL(*text.GetPointer(), SetBaseSize(_, _)).Times(0);
53-
54- text->PreLayoutManagement();
55-}
56-
57 }
58
59=== modified file 'unity-shared/StaticCairoText.cpp'
60--- unity-shared/StaticCairoText.cpp 2012-12-07 16:21:14 +0000
61+++ unity-shared/StaticCairoText.cpp 2012-12-10 00:35:27 +0000
62@@ -228,21 +228,12 @@
63
64 void StaticCairoText::PreLayoutManagement()
65 {
66- Geometry const& geo = GetGeometry();
67-
68- // only update the size if an only if and only if the width and height of
69- // the geo are diff
70- // FIXME: nux should be smart enough to not need this, we should get that
71- // fixed.
72- if(pimpl->pre_layout_size_.width != geo.width
73- || pimpl->pre_layout_size_.height != geo.height)
74- {
75- pimpl->pre_layout_size_.width = geo.width;
76- pimpl->pre_layout_size_.height = geo.height;
77-
78- SetBaseSize(pimpl->cached_extent_.width,
79- pimpl->cached_extent_.height);
80- }
81+ Geometry geo = GetGeometry();
82+ pimpl->pre_layout_size_.width = geo.width;
83+ pimpl->pre_layout_size_.height = geo.height;
84+
85+ SetBaseSize(pimpl->cached_extent_.width,
86+ pimpl->cached_extent_.height);
87
88 if (pimpl->textures2D_.empty())
89 {