Hash :
90c253a6
Author :
Date :
2015-12-15T15:14:08
Add an instancing perf test. BUG=526217 BUG=angleproject:1164 Change-Id: Ia353a3b2fa0ab0e8b7fd15d72bb63e5ecb7833b1 Reviewed-on: https://chromium-review.googlesource.com/301469 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tryjob-Request: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
//
// Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// random_utils:
// Helper functions for random number generation.
//
#include "random_utils.h"
#include <time.h>
#include <cstdlib>
namespace angle
{
void RandomInitFromTime()
{
srand(static_cast<unsigned int>(time(NULL)));
}
float RandomFloat()
{
return static_cast<float>(rand()) / static_cast<float>(RAND_MAX);
}
float RandomBetween(float min, float max)
{
return min + RandomFloat() * (max - min);
}
float RandomNegativeOneToOne()
{
return RandomBetween(0.0f, 1.0f);
}
} // namespace angle