2013-12-13 12:42:15 +08:00
|
|
|
#ifndef __PERFORMANCE_LABEL_TEST_H__
|
|
|
|
#define __PERFORMANCE_LABEL_TEST_H__
|
|
|
|
|
2015-05-11 16:26:14 +08:00
|
|
|
#include "BaseTest.h"
|
2013-12-13 12:42:15 +08:00
|
|
|
|
2015-05-11 16:26:14 +08:00
|
|
|
DEFINE_TEST_SUITE(PerformceLabelTests);
|
2013-12-13 12:42:15 +08:00
|
|
|
|
2015-05-11 16:26:14 +08:00
|
|
|
class LabelMainScene : public TestCase
|
2013-12-13 12:42:15 +08:00
|
|
|
{
|
|
|
|
public:
|
2013-12-18 10:46:02 +08:00
|
|
|
static const int AUTO_TEST_NODE_NUM = 20;
|
2013-12-13 12:42:15 +08:00
|
|
|
|
2015-05-11 16:26:14 +08:00
|
|
|
CREATE_FUNC(LabelMainScene);
|
|
|
|
|
2013-12-13 12:42:15 +08:00
|
|
|
virtual ~LabelMainScene();
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
std::string title() const;
|
2015-05-11 16:26:14 +08:00
|
|
|
virtual bool init() override;
|
2013-12-13 12:42:15 +08:00
|
|
|
void updateNodes();
|
|
|
|
|
2015-04-09 08:37:30 +08:00
|
|
|
void onIncrease(cocos2d::Ref* sender);
|
|
|
|
void onDecrease(cocos2d::Ref* sender);
|
2013-12-13 12:42:15 +08:00
|
|
|
|
|
|
|
int getSubTestNum() { return 1; }
|
|
|
|
int getNodesNum() { return _quantityNodes; }
|
|
|
|
|
|
|
|
void updateAutoTest(float dt);
|
|
|
|
void updateText(float dt);
|
2015-04-09 08:37:30 +08:00
|
|
|
void onAutoTest(cocos2d::Ref* sender);
|
2013-12-13 12:42:15 +08:00
|
|
|
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
|
|
|
|
2015-05-11 16:26:14 +08:00
|
|
|
virtual void nextTestCallback(cocos2d::Ref* sender) override;
|
|
|
|
virtual void priorTestCallback(cocos2d::Ref* sender) override;
|
|
|
|
|
2013-12-13 12:42:15 +08:00
|
|
|
static bool _s_autoTest;
|
|
|
|
static int _s_labelCurCase;
|
|
|
|
|
|
|
|
private:
|
2013-12-18 10:46:02 +08:00
|
|
|
static const int MAX_AUTO_TEST_TIMES = 35;
|
2013-12-13 12:42:15 +08:00
|
|
|
static const int MAX_SUB_TEST_NUMS = 5;
|
2015-05-11 16:26:14 +08:00
|
|
|
static int NODE_TEST_COUNT;
|
2013-12-13 12:42:15 +08:00
|
|
|
|
|
|
|
void dumpProfilerFPS();
|
|
|
|
|
|
|
|
void endAutoTest();
|
|
|
|
void nextAutoTest();
|
|
|
|
void finishAutoTest();
|
|
|
|
|
2015-05-11 16:26:14 +08:00
|
|
|
cocos2d::Layer* _labelContainer;
|
2013-12-13 12:42:15 +08:00
|
|
|
|
|
|
|
int _lastRenderedCount;
|
|
|
|
int _quantityNodes;
|
|
|
|
|
|
|
|
std::vector<float> _vecFPS;
|
|
|
|
int _executeTimes;
|
|
|
|
|
|
|
|
float _accumulativeTime;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|