mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
The context is already lost and we're really running shutdown when the process is woken up again. Additionally, orderly shutdown through the button doesn't happen on the render thread so remove a couple of asserts that are wrong.
61 lines
1.3 KiB
C++
61 lines
1.3 KiB
C++
#pragma once
|
|
|
|
#include <thread>
|
|
#include <string>
|
|
#include <functional>
|
|
|
|
#include "AndroidGraphicsContext.h"
|
|
#include "thin3d/GLRenderManager.h"
|
|
#include "thin3d/thin3d_create.h"
|
|
|
|
// Doesn't do much. Just to fit in.
|
|
class AndroidJavaEGLGraphicsContext : public AndroidGraphicsContext {
|
|
public:
|
|
AndroidJavaEGLGraphicsContext();
|
|
~AndroidJavaEGLGraphicsContext() {
|
|
delete draw_;
|
|
}
|
|
|
|
bool Initialized() override {
|
|
return draw_ != nullptr;
|
|
}
|
|
|
|
// This performs the actual initialization,
|
|
bool InitFromRenderThread(ANativeWindow *wnd, int desiredBackbufferSizeX, int desiredBackbufferSizeY, int backbufferFormat, int androidVersion) override;
|
|
|
|
void ShutdownFromRenderThread() override;
|
|
|
|
void Shutdown() override;
|
|
void SwapBuffers() override {}
|
|
void SwapInterval(int interval) override {}
|
|
void Resize() override {}
|
|
Draw::DrawContext *GetDrawContext() override {
|
|
return draw_;
|
|
}
|
|
|
|
void ThreadStart() override {
|
|
renderManager_->ThreadStart();
|
|
}
|
|
|
|
bool ThreadFrame() override {
|
|
return renderManager_->ThreadFrame();
|
|
}
|
|
|
|
void BeginAndroidShutdown() override {
|
|
renderManager_->SetSkipGLCalls();
|
|
}
|
|
|
|
void ThreadEnd() override {
|
|
renderManager_->ThreadEnd();
|
|
}
|
|
|
|
void StopThread() override {
|
|
renderManager_->WaitUntilQueueIdle();
|
|
renderManager_->StopThread();
|
|
}
|
|
|
|
private:
|
|
Draw::DrawContext *draw_ = nullptr;
|
|
GLRenderManager *renderManager_ = nullptr;
|
|
};
|
|
|