* Extended the BView drawing API by a DrawString() version that takes an array

of locations, one for each glyph.
 * Added a test for the new functionality.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35865 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2010-03-15 13:59:14 +00:00
parent f237e4182b
commit 77e5acc0d9
14 changed files with 329 additions and 21 deletions
+24 -1
View File
@@ -45,6 +45,7 @@
#include <String.h>
#include <Window.h>
#include <utf8_functions.h>
#include <AppMisc.h>
#include <AppServerLink.h>
#include <binary_compatibility/Interface.h>
@@ -59,7 +60,6 @@
#include <TokenSpace.h>
#include <ViewPrivate.h>
using std::nothrow;
//#define DEBUG_BVIEW
@@ -2570,6 +2570,29 @@ BView::DrawString(const char* string, int32 length, BPoint location,
}
void
BView::DrawString(const char* string, int32 length, const BPoint* locations)
{
if (fOwner == NULL || string == NULL || length < 1 || locations == NULL)
return;
_CheckLockAndSwitchCurrent();
fOwner->fLink->StartMessage(AS_DRAW_STRING_WITH_OFFSETS);
int32 glyphCount = UTF8CountChars(string, length);
fOwner->fLink->Attach<int32>(length);
fOwner->fLink->Attach<int32>(glyphCount);
fOwner->fLink->Attach(string, length);
fOwner->fLink->Attach(locations, glyphCount * sizeof(BPoint));
_FlushIfNotInTransaction();
// this modifies our pen location, so we invalidate the flag.
fState->valid_flags &= ~B_VIEW_PEN_LOCATION_BIT;
}
void
BView::StrokeEllipse(BPoint center, float xRadius, float yRadius,
::pattern pattern)