* 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:
Stephan Aßmus
2008-07-29 19:03:38 +00:00
parent 7c2658585f
commit 3cb3e0e210
8 changed files with 27 additions and 20 deletions
@@ -2,6 +2,7 @@
* Copyright (C) 2008 Stephan Aßmus <[email protected]> * Copyright (C) 2008 Stephan Aßmus <[email protected]>
* All rights reserved. Distributed under the terms of the MIT license. * All rights reserved. Distributed under the terms of the MIT license.
*/ */
#include <stdio.h> #include <stdio.h>
#include <Application.h> #include <Application.h>
@@ -15,9 +16,9 @@
class Benchmark : public BApplication { class Benchmark : public BApplication {
public: public:
Benchmark() Benchmark()
: BApplication("application/x-vnd.haiku-benchmark") : BApplication("application/x-vnd.haiku-benchmark"),
, fTest(new StringTest) fTest(new StringTest),
, fTestWindow(NULL) fTestWindow(NULL)
{ {
} }
@@ -37,7 +38,7 @@ public:
frame.right = frame.left + width - 1; frame.right = frame.left + width - 1;
frame.bottom = frame.top + height - 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)); BMessenger(this));
} }
+11 -10
View File
@@ -2,6 +2,7 @@
* Copyright (C) 2008 Stephan Aßmus <[email protected]> * Copyright (C) 2008 Stephan Aßmus <[email protected]>
* All rights reserved. Distributed under the terms of the MIT license. * All rights reserved. Distributed under the terms of the MIT license.
*/ */
#include "StringTest.h" #include "StringTest.h"
#include <stdio.h> #include <stdio.h>
@@ -13,16 +14,16 @@
StringTest::StringTest() StringTest::StringTest()
: Test() : Test(),
, fTestDuration(0) fTestDuration(0),
, fTestStart(-1) fTestStart(-1),
, fGlyphsRendered(0) fGlyphsRendered(0),
, fGlyphsPerLine(500) fGlyphsPerLine(500),
, fIterations(0) fIterations(0),
, fMaxIterations(1500) fMaxIterations(1500),
, fStartHeight(11.0) fStartHeight(11.0),
, fLineHeight(15.0) fLineHeight(15.0)
{ {
} }
@@ -72,7 +73,7 @@ StringTest::RunIteration(BView* view)
while (true) { while (true) {
// fill string with random chars // fill string with random chars
for (uint32 j = 0; j < fGlyphsPerLine; j++) for (uint32 j = 0; j < fGlyphsPerLine; j++)
buffer[j] = 'a' + rand() % ('Z' - 'a'); buffer[j] = 'A' + rand() % ('z' - 'A');
view->DrawString(buffer, textLocation); view->DrawString(buffer, textLocation);
@@ -2,6 +2,7 @@
* Copyright (C) 2008 Stephan Aßmus <[email protected]> * Copyright (C) 2008 Stephan Aßmus <[email protected]>
* All rights reserved. Distributed under the terms of the MIT license. * All rights reserved. Distributed under the terms of the MIT license.
*/ */
#ifndef STRING_TEST_H #ifndef STRING_TEST_H
#define STRING_TEST_H #define STRING_TEST_H
+1
View File
@@ -2,6 +2,7 @@
* Copyright (C) 2008 Stephan Aßmus <[email protected]> * Copyright (C) 2008 Stephan Aßmus <[email protected]>
* All rights reserved. Distributed under the terms of the MIT license. * All rights reserved. Distributed under the terms of the MIT license.
*/ */
#include "Test.h" #include "Test.h"
+1
View File
@@ -2,6 +2,7 @@
* Copyright (C) 2008 Stephan Aßmus <[email protected]> * Copyright (C) 2008 Stephan Aßmus <[email protected]>
* All rights reserved. Distributed under the terms of the MIT license. * All rights reserved. Distributed under the terms of the MIT license.
*/ */
#ifndef TEST_H #ifndef TEST_H
#define TEST_H #define TEST_H
@@ -2,6 +2,7 @@
* Copyright (C) 2008 Stephan Aßmus <[email protected]> * Copyright (C) 2008 Stephan Aßmus <[email protected]>
* All rights reserved. Distributed under the terms of the MIT license. * All rights reserved. Distributed under the terms of the MIT license.
*/ */
#ifndef TEST_SUPPORT_H #ifndef TEST_SUPPORT_H
#define TEST_SUPPORT_H #define TEST_SUPPORT_H
@@ -9,9 +9,9 @@
TestView::TestView(BRect frame, Test* test, drawing_mode mode, TestView::TestView(BRect frame, Test* test, drawing_mode mode,
const BMessenger& target) const BMessenger& target)
: BView(frame, "test view", B_FOLLOW_ALL, B_WILL_DRAW) : BView(frame, "test view", B_FOLLOW_ALL, B_WILL_DRAW),
, fTest(test) fTest(test),
, fTarget(target) fTarget(target)
{ {
SetDrawingMode(mode); SetDrawingMode(mode);
fTest->Prepare(this); fTest->Prepare(this);
@@ -33,9 +33,9 @@ TestView::Draw(BRect updateRect)
TestWindow::TestWindow(BRect frame, Test* test, drawing_mode mode, TestWindow::TestWindow(BRect frame, Test* test, drawing_mode mode,
const BMessenger& target) const BMessenger& target)
: BWindow(frame, "Test Window", B_TITLED_WINDOW_LOOK, : BWindow(frame, "Test Window", B_TITLED_WINDOW_LOOK,
B_FLOATING_ALL_WINDOW_FEEL, B_NOT_ZOOMABLE | B_NOT_RESIZABLE) B_FLOATING_ALL_WINDOW_FEEL, B_NOT_ZOOMABLE | B_NOT_RESIZABLE),
, fTarget(target) fTarget(target),
, fAllowedToQuit(false) fAllowedToQuit(false)
{ {
TestView* view = new TestView(Bounds(), test, mode, target); TestView* view = new TestView(Bounds(), test, mode, target);
AddChild(view); AddChild(view);
@@ -2,6 +2,7 @@
* Copyright (C) 2008 Stephan Aßmus <[email protected]> * Copyright (C) 2008 Stephan Aßmus <[email protected]>
* All rights reserved. Distributed under the terms of the MIT license. * All rights reserved. Distributed under the terms of the MIT license.
*/ */
#ifndef TEST_WINDOW_H #ifndef TEST_WINDOW_H
#define TEST_WINDOW_H #define TEST_WINDOW_H