* complete overhaul of the font/glyph caching

* the previous AGG implementation is superfluous
* the new implementation is based on that one, but in a way that allows
  read/write locking to the list of cache entries (fonts) as well as
  read/write locking to the cached glyphs per individual font cache entry
* new GlyphLayoutEngine.h, which is to be the central place for layouting
  glyphs along the baseline.
  It handles the locking for getting the font cache entries.
  It works by giving it a template class GlyphConsumer which does the
  actual work.
* changed AGGTextRenderer to use the new font cache
* changed ServerFont::StringWidth(), and the bounding box stuff to use it
* changed DrawingEngine, it doesn't need the global font lock anymore
* our BFont thought that GetBoundingBoxesAsGlyphs and GetBoundingBoxesAsString
  is the same, which of course it isn't, hence the two separate functions...
  AsGlyphs just gets the bounding box of each glyph in a string, not treating
  the string as an actual word
  AsString adds the offset of the glyph in the word to the bounding box
* changed ServerProtocol.h accordingly for the different bounding box meaning


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21797 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2007-08-02 19:10:38 +00:00
parent 693c7a1eaa
commit 2222864eed
24 changed files with 1841 additions and 1610 deletions
+10 -4
View File
@@ -1,11 +1,12 @@
/*
* Copyright 2001-2005, Haiku.
* Copyright 2001-2007, Haiku.
* Distributed under the terms of the MIT License.
*
* Authors:
* DarkWyrm <[email protected]>
* Jérôme Duval, [email protected]
* Axel Dörfler, [email protected]
* Stephan Aßmus <[email protected]>
*/
#ifndef SERVER_FONT_H
#define SERVER_FONT_H
@@ -15,6 +16,7 @@
#include <Rect.h>
#include "FontFamily.h"
#include "Transformable.h"
class BShape;
class BString;
@@ -135,11 +137,12 @@ class ServerFont {
int32 numChars, escapement_delta delta,
float widthArray[]) const;
status_t GetBoundingBoxesAsString(const char charArray[],
status_t GetBoundingBoxes(const char charArray[],
int32 numChars, BRect rectArray[],
bool stringEscapement,
font_metric_mode mode,
escapement_delta delta);
escapement_delta delta,
bool asString);
status_t GetBoundingBoxesForStrings(char *charArray[],
int32 lengthArray[], int32 numStrings,
@@ -147,7 +150,8 @@ class ServerFont {
escapement_delta deltaArray[]);
float StringWidth(const char *string,
int32 numChars) const;
int32 numChars,
const escapement_delta* delta = NULL) const;
bool Lock() const { return fStyle->Lock(); }
void Unlock() const { fStyle->Unlock(); }
@@ -162,6 +166,8 @@ class ServerFont {
uint32 mode,
float width) const;
Transformable EmbeddedTransformation() const;
protected:
friend class FontStyle;