Move DisplayMode out of SurfaceHandler

Summary:
This diff moves DisplayMode out of SurfaceHandler, this is necessary in order to use it from react/uimanager package

changelog: [internal] internal

Reviewed By: ShikaSD

Differential Revision: D27669846

fbshipit-source-id: 274869d8f2907b1b159f51240440acece09a746f
This commit is contained in:
David Vacca
2021-04-12 00:05:43 -07:00
committed by Facebook GitHub Bot
parent 84c70b2a7f
commit 2793bba278
4 changed files with 36 additions and 38 deletions
@@ -17,14 +17,13 @@ SurfaceHandlerBinding::SurfaceHandlerBinding(
: surfaceHandler_(moduleName, surfaceId) {}
void SurfaceHandlerBinding::setDisplayMode(jint mode) {
surfaceHandler_.setDisplayMode(
static_cast<SurfaceHandler::DisplayMode>(mode));
surfaceHandler_.setDisplayMode(static_cast<DisplayMode>(mode));
}
void SurfaceHandlerBinding::start() {
std::unique_lock<better::shared_mutex> lock(lifecycleMutex_);
surfaceHandler_.setDisplayMode(SurfaceHandler::DisplayMode::Visible);
surfaceHandler_.setDisplayMode(DisplayMode::Visible);
if (surfaceHandler_.getStatus() != SurfaceHandler::Status::Running) {
surfaceHandler_.start();
}