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
=== modified file 'tests/test_static_cairo_text.cpp'
--- tests/test_static_cairo_text.cpp 2012-12-05 13:11:28 +0000
+++ tests/test_static_cairo_text.cpp 2012-12-10 00:35:27 +0000
@@ -33,29 +33,17 @@
33class MockStaticCairoText : public nux::StaticCairoText33class MockStaticCairoText : public nux::StaticCairoText
34{34{
35public:35public:
36 MOCK_METHOD2(SetBaseSize, void(int, int));
37
38 MockStaticCairoText():StaticCairoText("") {}36 MockStaticCairoText():StaticCairoText("") {}
3937
40 using StaticCairoText::GetTextureStartIndices;38 using StaticCairoText::GetTextureStartIndices;
41 using StaticCairoText::GetTextureEndIndices;39 using StaticCairoText::GetTextureEndIndices;
42 using StaticCairoText::PreLayoutManagement;40};
43};41
4442TEST(TestStaticCairoText, TextTextureSize)
45class TestStaticCairoText : public ::testing::Test43{
46{
47 protected:
48 TestStaticCairoText() : Test()
49 {
50 text = new MockStaticCairoText();
51 }
52 nux::ObjectPtr<MockStaticCairoText> text;
53};
54
55TEST_F(TestStaticCairoText, TextTextureSize)
56{
57 EXPECT_CALL(*text.GetPointer(), SetBaseSize(_, _)).Times(AnyNumber());
58 // Test multi-texture stitching support.44 // Test multi-texture stitching support.
45
46 nux::ObjectPtr<MockStaticCairoText> text(new MockStaticCairoText());
59 text->SetLines(-2000);47 text->SetLines(-2000);
60 text->SetMaximumWidth(100);48 text->SetMaximumWidth(100);
6149
@@ -82,17 +70,4 @@
82 }70 }
83}71}
8472
85TEST_F(TestStaticCairoText, TextPreLayoutManagementMultipleCalls)
86{
87 EXPECT_CALL(*text.GetPointer(), SetBaseSize(_, _)).Times(2);
88
89 text->PreLayoutManagement();
90
91 // the first prelayout methods should have called set base size and therefore
92 // we should not call it again
93 EXPECT_CALL(*text.GetPointer(), SetBaseSize(_, _)).Times(0);
94
95 text->PreLayoutManagement();
96}
97
98}73}
9974
=== modified file 'unity-shared/StaticCairoText.cpp'
--- unity-shared/StaticCairoText.cpp 2012-12-07 16:21:14 +0000
+++ unity-shared/StaticCairoText.cpp 2012-12-10 00:35:27 +0000
@@ -228,21 +228,12 @@
228228
229void StaticCairoText::PreLayoutManagement()229void StaticCairoText::PreLayoutManagement()
230{230{
231 Geometry const& geo = GetGeometry();231 Geometry geo = GetGeometry();
232232 pimpl->pre_layout_size_.width = geo.width;
233 // only update the size if an only if and only if the width and height of233 pimpl->pre_layout_size_.height = geo.height;
234 // the geo are diff234
235 // FIXME: nux should be smart enough to not need this, we should get that235 SetBaseSize(pimpl->cached_extent_.width,
236 // fixed.236 pimpl->cached_extent_.height);
237 if(pimpl->pre_layout_size_.width != geo.width
238 || pimpl->pre_layout_size_.height != geo.height)
239 {
240 pimpl->pre_layout_size_.width = geo.width;
241 pimpl->pre_layout_size_.height = geo.height;
242
243 SetBaseSize(pimpl->cached_extent_.width,
244 pimpl->cached_extent_.height);
245 }
246237
247 if (pimpl->textures2D_.empty())238 if (pimpl->textures2D_.empty())
248 {239 {