Hash :
9190f49c
Author :
Date :
2019-12-16T16:03:57
GN: Make new angle_test_utils target. This source set target lets other targets import the test utils without needing to export them. They get built into angle_util. They also get compiled into the various tests and samples. The change also fixes export issues. Moves some of the GN logic into the util/ subfolder. Bug: angleproject:3162 Bug: chromium:1030192 Change-Id: If99d201092ad8541c0de60b3bd893ac9b5875270 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1968259 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: 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 38
//
// Copyright 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.
//
// test_utils_win32.cpp: Implementation of OS-specific functions for Win32 (Windows)
#include "util/test_utils.h"
#include <windows.h>
#include <array>
namespace angle
{
void SetLowPriorityProcess()
{
::SetPriorityClass(::GetCurrentProcess(), BELOW_NORMAL_PRIORITY_CLASS);
}
bool StabilizeCPUForBenchmarking()
{
if (::SetThreadAffinityMask(::GetCurrentThread(), 1) == 0)
{
return false;
}
if (::SetPriorityClass(::GetCurrentProcess(), REALTIME_PRIORITY_CLASS) == FALSE)
{
return false;
}
if (::SetThreadPriority(::GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL) == FALSE)
{
return false;
}
return true;
}
} // namespace angle