Hash :
6bd58312
Author :
Date :
2015-03-13T10:45:27
Make Platform methods global. This will allow them to be imported dynamically without name mangling. This is necessary because sometimes SwiftShader overrides libGLESv2 and libEGL, so we need to determine at run-time if we are running with "actual" ANGLE. BUG=466735 Change-Id: I396d717b79066feb8ed0d577ee7386b33eb1d160 Reviewed-on: https://chromium-review.googlesource.com/259954 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
//
// Copyright 2015 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.
//
// Platform.cpp: Implementation methods for angle::Platform.
#include <platform/Platform.h>
#include "common/debug.h"
namespace
{
angle::Platform *currentPlatform = nullptr;
}
// static
ANGLE_EXPORT angle::Platform *ANGLEPlatformCurrent()
{
return currentPlatform;
}
// static
ANGLE_EXPORT void ANGLEPlatformInitialize(angle::Platform *platformImpl)
{
ASSERT(platformImpl != nullptr);
currentPlatform = platformImpl;
}
// static
ANGLE_EXPORT void ANGLEPlatformShutdown()
{
currentPlatform = nullptr;
}