* Fixed coding style issues pointed out by Axel
* Use more letters of the roman alphabet (doh...) * Tested drawing mode is currently B_OP_COPY git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26681 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
7c2658585f
commit
3cb3e0e210
@ -2,6 +2,7 @@
|
||||
* Copyright (C) 2008 Stephan Aßmus <superstippi@gmx.de>
|
||||
* All rights reserved. Distributed under the terms of the MIT license.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <Application.h>
|
||||
@ -15,9 +16,9 @@
|
||||
class Benchmark : public BApplication {
|
||||
public:
|
||||
Benchmark()
|
||||
: BApplication("application/x-vnd.haiku-benchmark")
|
||||
, fTest(new StringTest)
|
||||
, fTestWindow(NULL)
|
||||
: BApplication("application/x-vnd.haiku-benchmark"),
|
||||
fTest(new StringTest),
|
||||
fTestWindow(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
@ -37,7 +38,7 @@ public:
|
||||
frame.right = frame.left + width - 1;
|
||||
frame.bottom = frame.top + height - 1;
|
||||
|
||||
fTestWindow = new TestWindow(frame, fTest, B_OP_OVER,
|
||||
fTestWindow = new TestWindow(frame, fTest, B_OP_COPY,
|
||||
BMessenger(this));
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
* Copyright (C) 2008 Stephan Aßmus <superstippi@gmx.de>
|
||||
* All rights reserved. Distributed under the terms of the MIT license.
|
||||
*/
|
||||
|
||||
#include "StringTest.h"
|
||||
|
||||
#include <stdio.h>
|
||||
@ -13,16 +14,16 @@
|
||||
|
||||
|
||||
StringTest::StringTest()
|
||||
: Test()
|
||||
, fTestDuration(0)
|
||||
, fTestStart(-1)
|
||||
, fGlyphsRendered(0)
|
||||
, fGlyphsPerLine(500)
|
||||
, fIterations(0)
|
||||
, fMaxIterations(1500)
|
||||
: Test(),
|
||||
fTestDuration(0),
|
||||
fTestStart(-1),
|
||||
fGlyphsRendered(0),
|
||||
fGlyphsPerLine(500),
|
||||
fIterations(0),
|
||||
fMaxIterations(1500),
|
||||
|
||||
, fStartHeight(11.0)
|
||||
, fLineHeight(15.0)
|
||||
fStartHeight(11.0),
|
||||
fLineHeight(15.0)
|
||||
{
|
||||
}
|
||||
|
||||
@ -72,7 +73,7 @@ StringTest::RunIteration(BView* view)
|
||||
while (true) {
|
||||
// fill string with random chars
|
||||
for (uint32 j = 0; j < fGlyphsPerLine; j++)
|
||||
buffer[j] = 'a' + rand() % ('Z' - 'a');
|
||||
buffer[j] = 'A' + rand() % ('z' - 'A');
|
||||
|
||||
view->DrawString(buffer, textLocation);
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
* Copyright (C) 2008 Stephan Aßmus <superstippi@gmx.de>
|
||||
* All rights reserved. Distributed under the terms of the MIT license.
|
||||
*/
|
||||
|
||||
#ifndef STRING_TEST_H
|
||||
#define STRING_TEST_H
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
* Copyright (C) 2008 Stephan Aßmus <superstippi@gmx.de>
|
||||
* All rights reserved. Distributed under the terms of the MIT license.
|
||||
*/
|
||||
|
||||
#include "Test.h"
|
||||
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
* Copyright (C) 2008 Stephan Aßmus <superstippi@gmx.de>
|
||||
* All rights reserved. Distributed under the terms of the MIT license.
|
||||
*/
|
||||
|
||||
#ifndef TEST_H
|
||||
#define TEST_H
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
* Copyright (C) 2008 Stephan Aßmus <superstippi@gmx.de>
|
||||
* All rights reserved. Distributed under the terms of the MIT license.
|
||||
*/
|
||||
|
||||
#ifndef TEST_SUPPORT_H
|
||||
#define TEST_SUPPORT_H
|
||||
|
||||
|
@ -9,9 +9,9 @@
|
||||
|
||||
TestView::TestView(BRect frame, Test* test, drawing_mode mode,
|
||||
const BMessenger& target)
|
||||
: BView(frame, "test view", B_FOLLOW_ALL, B_WILL_DRAW)
|
||||
, fTest(test)
|
||||
, fTarget(target)
|
||||
: BView(frame, "test view", B_FOLLOW_ALL, B_WILL_DRAW),
|
||||
fTest(test),
|
||||
fTarget(target)
|
||||
{
|
||||
SetDrawingMode(mode);
|
||||
fTest->Prepare(this);
|
||||
@ -33,9 +33,9 @@ TestView::Draw(BRect updateRect)
|
||||
TestWindow::TestWindow(BRect frame, Test* test, drawing_mode mode,
|
||||
const BMessenger& target)
|
||||
: BWindow(frame, "Test Window", B_TITLED_WINDOW_LOOK,
|
||||
B_FLOATING_ALL_WINDOW_FEEL, B_NOT_ZOOMABLE | B_NOT_RESIZABLE)
|
||||
, fTarget(target)
|
||||
, fAllowedToQuit(false)
|
||||
B_FLOATING_ALL_WINDOW_FEEL, B_NOT_ZOOMABLE | B_NOT_RESIZABLE),
|
||||
fTarget(target),
|
||||
fAllowedToQuit(false)
|
||||
{
|
||||
TestView* view = new TestView(Bounds(), test, mode, target);
|
||||
AddChild(view);
|
||||
|
@ -2,6 +2,7 @@
|
||||
* Copyright (C) 2008 Stephan Aßmus <superstippi@gmx.de>
|
||||
* All rights reserved. Distributed under the terms of the MIT license.
|
||||
*/
|
||||
|
||||
#ifndef TEST_WINDOW_H
|
||||
#define TEST_WINDOW_H
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user