app_server: Style and comment cleanup, no functional change.

This commit is contained in:
Michael Lotz
2018-12-29 00:52:05 +01:00
parent e7933432e9
commit 9dad3fb4b0
4 changed files with 43 additions and 29 deletions
+2 -3
View File
@@ -2065,7 +2065,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
// Attached Data:
// 1) uint16 family ID
// 2) uint16 style ID
// 3 uint32 start of unicode block
// 3) uint32 start of unicode block
// 4) uint32 end of unicode block
// Returns:
@@ -2107,7 +2107,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
// 6) uint32 - flags
// 7) int32 - numChars
// 8) int32 - numBytes
// 8) char - chars (bytesInBuffer times)
// 8) char - chars (numBytes times)
// Returns:
// 1) BShape - glyph shape
@@ -2300,7 +2300,6 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
delete[] charArray;
delete[] escapements;
delete[] offsets;
fLink.StartMessage(B_NO_MEMORY);
fLink.Flush();
break;
+29 -13
View File
@@ -669,9 +669,11 @@ ServerFont::IncludesUnicodeBlock(uint32 start, uint32 end, bool& hasBlock)
class HasGlyphsConsumer {
public:
HasGlyphsConsumer(bool* hasArray)
: fHasArray(hasArray)
:
fHasArray(hasArray)
{
}
bool NeedsVector() { return false; }
void Start() {}
void Finish(double x, double y) {}
@@ -679,6 +681,7 @@ class HasGlyphsConsumer {
{
fHasArray[index] = false;
}
bool ConsumeGlyph(int32 index, uint32 charCode, const GlyphCache* glyph,
FontCacheEntry* entry, double x, double y, double advanceX,
double advanceY)
@@ -711,10 +714,12 @@ ServerFont::GetHasGlyphs(const char* string, int32 numBytes,
class EdgesConsumer {
public:
EdgesConsumer(edge_info* edges, float size)
: fEdges(edges)
, fSize(size)
:
fEdges(edges),
fSize(size)
{
}
bool NeedsVector() { return false; }
void Start() {}
void Finish(double x, double y) {}
@@ -723,6 +728,7 @@ class EdgesConsumer {
fEdges[index].left = 0.0;
fEdges[index].right = 0.0;
}
bool ConsumeGlyph(int32 index, uint32 charCode, const GlyphCache* glyph,
FontCacheEntry* entry, double x, double y, double advanceX,
double advanceY)
@@ -894,6 +900,7 @@ ServerFont::GetEscapements(const char* string, int32 numBytes, int32 numChars,
&delta, fSpacing)) {
return B_OK;
}
return B_ERROR;
}
@@ -902,14 +909,15 @@ class BoundingBoxConsumer {
public:
BoundingBoxConsumer(Transformable& transform, BRect* rectArray,
bool asString)
: rectArray(rectArray)
, stringBoundingBox(INT32_MAX, INT32_MAX, INT32_MIN, INT32_MIN)
, fAsString(asString)
, fCurves(fPathAdaptor)
, fContour(fCurves)
, fTransformedOutline(fCurves, transform)
, fTransformedContourOutline(fContour, transform)
, fTransform(transform)
:
rectArray(rectArray),
stringBoundingBox(INT32_MAX, INT32_MAX, INT32_MIN, INT32_MIN),
fAsString(asString),
fCurves(fPathAdaptor),
fContour(fCurves),
fTransformedOutline(fCurves, transform),
fTransformedContourOutline(fContour, transform),
fTransform(transform)
{
}
@@ -917,6 +925,7 @@ class BoundingBoxConsumer {
void Start() {}
void Finish(double x, double y) {}
void ConsumeEmptyGlyph(int32 index, uint32 charCode, double x, double y) {}
bool ConsumeGlyph(int32 index, uint32 charCode, const GlyphCache* glyph,
FontCacheEntry* entry, double x, double y, double advanceX,
double advanceY)
@@ -1038,7 +1047,12 @@ ServerFont::GetBoundingBoxesForStrings(char *charArray[], int32 lengthArray[],
class StringWidthConsumer {
public:
StringWidthConsumer() : width(0.0) {}
StringWidthConsumer()
:
width(0.0)
{
}
bool NeedsVector() { return false; }
void Start() {}
void Finish(double x, double y) { width = x; }
@@ -1046,7 +1060,9 @@ class StringWidthConsumer {
bool ConsumeGlyph(int32 index, uint32 charCode, const GlyphCache* glyph,
FontCacheEntry* entry, double x, double y, double advanceX,
double advanceY)
{ return true; }
{
return true;
}
float width;
};
+11 -12
View File
@@ -27,12 +27,11 @@ class ServerFont {
public:
ServerFont();
ServerFont(FontStyle& style,
float size = 12.0,
float rotation = 0.0,
float shear = 90.0,
float falseBoldWidth = 0.0,
uint16 flags = 0,
uint8 spacing = B_BITMAP_SPACING);
float size = 12.0, float rotation = 0.0,
float shear = 90.0,
float falseBoldWidth = 0.0,
uint16 flags = 0,
uint8 spacing = B_BITMAP_SPACING);
ServerFont(const ServerFont& font);
virtual ~ServerFont();
@@ -70,7 +69,7 @@ class ServerFont {
void SetStyle(FontStyle* style);
status_t SetFamilyAndStyle(uint16 familyID,
uint16 styleID);
uint16 styleID);
status_t SetFamilyAndStyle(uint32 fontID);
uint16 StyleID() const
@@ -159,19 +158,19 @@ class ServerFont {
void GetHeight(font_height& height) const;
void TruncateString(BString* inOut,
uint32 mode,
float width) const;
uint32 mode, float width) const;
Transformable EmbeddedTransformation() const;
status_t GetUnicodeBlocks(unicode_block &blocksForFont);
status_t IncludesUnicodeBlock(uint32 start, uint32 end, bool &hasBlock);
status_t GetUnicodeBlocks(unicode_block &blocksForFont);
status_t IncludesUnicodeBlock(uint32 start, uint32 end,
bool &hasBlock);
protected:
friend class FontStyle;
FT_Face GetTransformedFace(bool rotate,
bool shear) const;
void PutTransformedFace(FT_Face face) const;
FontStyle* fStyle;
float fSize;
float fRotation;
+1 -1
View File
@@ -309,7 +309,7 @@ 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();
if (writeLocked) {