[haiku-commits] haiku: hrev50094 - in src: tests/kits/interface/layout/widget_layout_test servers/app/font apps/charactermap tests/kits/interface/picture preferences/locale

  • From: pulkomandy@xxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 14 Feb 2016 21:13:20 +0100 (CET)

hrev50094 adds 4 changesets to branch 'master'
old head: e9eb82cc53ef7eb06dd0eb436fa28f5397feab0b
new head: 6071ca920926896ae03b17df943506ab597dec52
overview: 
http://cgit.haiku-os.org/haiku/log/?qt=range&q=6071ca920926+%5Ee9eb82cc53ef

----------------------------------------------------------------------------

884412df8e67: Fix test_app_server build, again
  
  - Interface Kit tests use a View class which is not BView, and has no
  SetViewUIColor.
  - Libexpat is now in a separate package.
  - Shouldn't we add this to the buildbots so we can cath the breakage?

15325401ceef: app_server: do not return a glyph when nothing is found in the 
font.
  
  - Fixes BFont::GetHasGlyphs, the "empty square" which was returned led
    it to think the font had glyphs for everything
  - This means the "no character" empty square will not be drawn anymore,
    if we want it back, we will need to rework the implementation a bit
    more (either request it explicitly when there is a missing glyph, or
    return it as it was before but including an info that it is the
    "missing glyph")
  - Maybe GetHasGlyphs should also bypass the font fallback system, and
    return what's actually in the requested font only.
  
  This also fixes a locking problem in the GlyphLayoutEngine, the code
  didn't handle the read/write lock properly and tried to ReadUnlock from
  a place where only the write lock was held.

42d17c1c2f39: Remove TODO, fixed by the previous commit.

6071ca920926: Allow to build CharacterMap for the test_app_server.
  
  - I needed to test missing glyphs, and none of the available test apps
    allowed to do so.

                             [ Adrien Destugues <pulkomandy@xxxxxxxxxxxxx> ]

----------------------------------------------------------------------------

11 files changed, 32 insertions(+), 16 deletions(-)
src/apps/charactermap/Jamfile                        |  6 ++++++
src/preferences/locale/LocaleWindow.cpp              |  2 --
src/servers/app/font/FontCacheEntry.cpp              |  3 ++-
src/servers/app/font/GlyphLayoutEngine.h             | 16 ++++++++++++----
.../interface/layout/widget_layout_test/CheckBox.cpp |  2 +-
.../layout/widget_layout_test/GroupView.cpp          |  6 +++---
.../layout/widget_layout_test/RadioButton.cpp        |  2 +-
.../layout/widget_layout_test/StringView.cpp         |  2 +-
.../layout/widget_layout_test/WidgetLayoutTest.cpp   |  4 ++--
src/tests/kits/interface/picture/Jamfile             |  4 +++-
src/tests/servers/app/Jamfile                        |  1 +

############################################################################

Commit:      884412df8e67a4f2546b46722ab18868d7439202
URL:         http://cgit.haiku-os.org/haiku/commit/?id=884412df8e67
Author:      Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Date:        Sun Feb 14 17:46:37 2016 UTC

Fix test_app_server build, again

- Interface Kit tests use a View class which is not BView, and has no
SetViewUIColor.
- Libexpat is now in a separate package.
- Shouldn't we add this to the buildbots so we can cath the breakage?

----------------------------------------------------------------------------

diff --git a/src/tests/kits/interface/layout/widget_layout_test/CheckBox.cpp 
b/src/tests/kits/interface/layout/widget_layout_test/CheckBox.cpp
index d2374a3..6598507 100644
--- a/src/tests/kits/interface/layout/widget_layout_test/CheckBox.cpp
+++ b/src/tests/kits/interface/layout/widget_layout_test/CheckBox.cpp
@@ -16,7 +16,7 @@
 CheckBox::CheckBox(BMessage* message, BMessenger target)
        : AbstractButton(BUTTON_POLICY_TOGGLE_ON_RELEASE, message, target)
 {
-       SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
+       SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
 }
 
 
diff --git a/src/tests/kits/interface/layout/widget_layout_test/GroupView.cpp 
b/src/tests/kits/interface/layout/widget_layout_test/GroupView.cpp
index 2b6f24a..67dcd70 100644
--- a/src/tests/kits/interface/layout/widget_layout_test/GroupView.cpp
+++ b/src/tests/kits/interface/layout/widget_layout_test/GroupView.cpp
@@ -59,7 +59,7 @@ GroupView::GroupView(enum orientation orientation, int32 
lineCount)
          fColumnInfos(NULL),
          fRowInfos(NULL)
 {
-       SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
+       SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
 
        if (fLineCount < 1)
                fLineCount = 1;
@@ -377,7 +377,7 @@ GroupView::_ChildAt(int32 column, int32 row) const
 Glue::Glue()
        : View()
 {
-       SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
+       SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
 }
 
 
@@ -389,7 +389,7 @@ Strut::Strut(float pixelWidth, float pixelHeight)
          fSize(pixelWidth >= 0 ? pixelWidth - 1 : B_SIZE_UNSET,
                pixelHeight >= 0 ? pixelHeight - 1 : B_SIZE_UNSET)
 {
-       SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
+       SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
 }
 
 
diff --git a/src/tests/kits/interface/layout/widget_layout_test/RadioButton.cpp 
b/src/tests/kits/interface/layout/widget_layout_test/RadioButton.cpp
index beb0a08..07c70de 100644
--- a/src/tests/kits/interface/layout/widget_layout_test/RadioButton.cpp
+++ b/src/tests/kits/interface/layout/widget_layout_test/RadioButton.cpp
@@ -16,7 +16,7 @@
 RadioButton::RadioButton(BMessage* message, BMessenger target)
        : AbstractButton(BUTTON_POLICY_SELECT_ON_RELEASE, message, target)
 {
-       SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
+       SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
 }
 
 
diff --git a/src/tests/kits/interface/layout/widget_layout_test/StringView.cpp 
b/src/tests/kits/interface/layout/widget_layout_test/StringView.cpp
index 7721834..2f3db79 100644
--- a/src/tests/kits/interface/layout/widget_layout_test/StringView.cpp
+++ b/src/tests/kits/interface/layout/widget_layout_test/StringView.cpp
@@ -19,7 +19,7 @@ StringView::StringView(const char* string)
          fStringWidth(0),
          fExplicitMinSize(B_SIZE_UNSET, B_SIZE_UNSET)
 {
-       SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
+       SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
        fTextColor = (rgb_color){ 0, 0, 0, 255 };
 }
 
diff --git 
a/src/tests/kits/interface/layout/widget_layout_test/WidgetLayoutTest.cpp 
b/src/tests/kits/interface/layout/widget_layout_test/WidgetLayoutTest.cpp
index afa9931..8132511 100644
--- a/src/tests/kits/interface/layout/widget_layout_test/WidgetLayoutTest.cpp
+++ b/src/tests/kits/interface/layout/widget_layout_test/WidgetLayoutTest.cpp
@@ -79,7 +79,7 @@ public:
                  fTest(test)
        {
                fViewContainer = new ViewContainer(Bounds());
-               fViewContainer->View::SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
+               
fViewContainer->View::SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
                AddChild(fViewContainer);
 
                // container view for the tested BView
@@ -90,7 +90,7 @@ public:
 
                // container for the test's controls
                fTestControlsView = new View(BRect(410, 10, 690, 400));
-               fTestControlsView->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
+               
fTestControlsView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
                fViewContainer->View::AddChild(fTestControlsView);
 
                // wrapper view
diff --git a/src/tests/kits/interface/picture/Jamfile 
b/src/tests/kits/interface/picture/Jamfile
index 8ded430..280bd1c 100644
--- a/src/tests/kits/interface/picture/Jamfile
+++ b/src/tests/kits/interface/picture/Jamfile
@@ -23,7 +23,9 @@ UseLibraryHeaders agg expat ;
 SimpleTest PictureTest :
        PictureTest.cpp
        SVGViewView.cpp
-       : be translation libexpat.a [ TargetLibsupc++ ]
+       : be translation 
+       [ BuildFeatureAttribute expat : library ]
+       [ TargetLibsupc++ ]
        ;
 
 if $(TARGET_PLATFORM) = libbe_test {
diff --git a/src/tests/servers/app/Jamfile b/src/tests/servers/app/Jamfile
index 732c19e..deb4347 100644
--- a/src/tests/servers/app/Jamfile
+++ b/src/tests/servers/app/Jamfile
@@ -101,6 +101,7 @@ SharedLibrary libtestappserver.so :
        CursorData.cpp
        CursorManager.cpp
        CursorSet.cpp
+       DelayedMessage.cpp
        DesktopListener.cpp
        DirectWindowInfo.cpp
        DrawingEngine.cpp

############################################################################

Commit:      15325401ceeffbac7348f8b7ac518d0d47a2efc2
URL:         http://cgit.haiku-os.org/haiku/commit/?id=15325401ceef
Author:      Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Date:        Sun Feb 14 19:59:16 2016 UTC

app_server: do not return a glyph when nothing is found in the font.

- Fixes BFont::GetHasGlyphs, the "empty square" which was returned led
  it to think the font had glyphs for everything
- This means the "no character" empty square will not be drawn anymore,
  if we want it back, we will need to rework the implementation a bit
  more (either request it explicitly when there is a missing glyph, or
  return it as it was before but including an info that it is the
  "missing glyph")
- Maybe GetHasGlyphs should also bypass the font fallback system, and
  return what's actually in the requested font only.

This also fixes a locking problem in the GlyphLayoutEngine, the code
didn't handle the read/write lock properly and tried to ReadUnlock from
a place where only the write lock was held.

----------------------------------------------------------------------------

diff --git a/src/servers/app/font/FontCacheEntry.cpp 
b/src/servers/app/font/FontCacheEntry.cpp
index 39b64d2..fd2428d 100644
--- a/src/servers/app/font/FontCacheEntry.cpp
+++ b/src/servers/app/font/FontCacheEntry.cpp
@@ -304,7 +304,8 @@ FontCacheEntry::CreateGlyph(uint32 glyphCode, 
FontCacheEntry* fallbackEntry)
                        // get the normal space glyph
                        glyphIndex = engine->GlyphIndexForGlyphCode(0x20 /* 
space */);
                } else {
-                       // render the "missing glyph box" (by simply keeping 
glyphIndex 0)
+                       // The glyph was not found anywhere.
+                       return NULL;
                }
        }
 
diff --git a/src/servers/app/font/GlyphLayoutEngine.h 
b/src/servers/app/font/GlyphLayoutEngine.h
index 8ed8d19..963c0ca 100644
--- a/src/servers/app/font/GlyphLayoutEngine.h
+++ b/src/servers/app/font/GlyphLayoutEngine.h
@@ -309,9 +309,15 @@ GlyphLayoutEngine::_WriteLockAndAcquireFallbackEntry(
        // glyphs from it. We need to obtain the fallback font while we have not
        // locked anything, since locking the FontManager with the write-lock 
held
        // can obvisouly lead to a deadlock.
+       
+       bool writeLocked = entry->IsWriteLocked();
 
-       cacheReference.SetTo(NULL, false);
-       entry->ReadUnlock();
+       if (writeLocked) {
+               entry->WriteUnlock();
+       } else {
+               cacheReference.SetTo(NULL, false);
+               entry->ReadUnlock();
+       }
 
        if (gFontManager->Lock()) {
                // TODO: We always get the fallback glyphs from VL Gothic at the
@@ -342,8 +348,10 @@ GlyphLayoutEngine::_WriteLockAndAcquireFallbackEntry(
                return false;
        }
 
-       // Update the FontCacheReference, since the locking kind changed.
-       cacheReference.SetTo(entry, true);
+       if (!writeLocked) {
+               // Update the FontCacheReference, since the locking kind 
changed.
+               cacheReference.SetTo(entry, true);
+       }
        return true;
 }
 

############################################################################

Commit:      42d17c1c2f39b002e2551265698f9f580c415284
URL:         http://cgit.haiku-os.org/haiku/commit/?id=42d17c1c2f39
Author:      Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Date:        Sun Feb 14 20:07:05 2016 UTC

Remove TODO, fixed by the previous commit.

----------------------------------------------------------------------------

diff --git a/src/preferences/locale/LocaleWindow.cpp 
b/src/preferences/locale/LocaleWindow.cpp
index 6d50151..0eff716 100644
--- a/src/preferences/locale/LocaleWindow.cpp
+++ b/src/preferences/locale/LocaleWindow.cpp
@@ -111,8 +111,6 @@ LocaleWindow::LocaleWindow()
                        BLanguage currentLanguage(currentID.String());
                        currentLanguage.GetNativeName(name);
 
-                       // TODO: the following block fails to detect a couple 
of language
-                       // names as containing glyphs we can't render. Why's 
that?
                        int nameLength = name.CountChars();
                        bool hasGlyphs[nameLength];
                        font.GetHasGlyphs(name.String(), nameLength, hasGlyphs);

############################################################################

Revision:    hrev50094
Commit:      6071ca920926896ae03b17df943506ab597dec52
URL:         http://cgit.haiku-os.org/haiku/commit/?id=6071ca920926
Author:      Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Date:        Sun Feb 14 20:08:45 2016 UTC

Allow to build CharacterMap for the test_app_server.

- I needed to test missing glyphs, and none of the available test apps
  allowed to do so.

----------------------------------------------------------------------------

diff --git a/src/apps/charactermap/Jamfile b/src/apps/charactermap/Jamfile
index 23b8fe5..b4d625a 100644
--- a/src/apps/charactermap/Jamfile
+++ b/src/apps/charactermap/Jamfile
@@ -1,6 +1,7 @@
 SubDir HAIKU_TOP src apps charactermap ;
 
 SetSubDirSupportedPlatformsBeOSCompatible ;
+AddSubDirSupportedPlatforms libbe_test ;
 
 UsePrivateHeaders shared system ;
 
@@ -23,3 +24,8 @@ DoCatalogs CharacterMap :
        CharacterWindow.cpp
        UnicodeBlocks.cpp
 ;
+
+if $(TARGET_PLATFORM) = libbe_test {
+       HaikuInstall install-test-apps : $(HAIKU_APP_TEST_DIR) : CharacterMap
+               : tests!apps ;
+}


Other related posts: