summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_node.cpp2
-rw-r--r--editor/editor_resource_preview.cpp23
-rw-r--r--editor/editor_resource_preview.h8
3 files changed, 2 insertions, 31 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 194021669f..3b71c85422 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -623,8 +623,6 @@ void EditorNode::_notification(int p_what) {
ResourceImporterTexture::get_singleton()->update_imports();
- // if using a main thread only renderer, we need to update the resource previews
- EditorResourcePreview::get_singleton()->update();
} break;
case NOTIFICATION_ENTER_TREE: {
diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp
index 6d5b20e591..dffb378408 100644
--- a/editor/editor_resource_preview.cpp
+++ b/editor/editor_resource_preview.cpp
@@ -430,12 +430,8 @@ void EditorResourcePreview::check_for_invalidation(const String &p_path) {
}
void EditorResourcePreview::start() {
- if (OS::get_singleton()->get_render_main_thread_mode() == OS::RENDER_ANY_THREAD) {
- ERR_FAIL_COND_MSG(thread.is_started(), "Thread already started.");
- thread.start(_thread_func, this);
- } else {
- _mainthread_only = true;
- }
+ ERR_FAIL_COND_MSG(thread.is_started(), "Thread already started.");
+ thread.start(_thread_func, this);
}
void EditorResourcePreview::stop() {
@@ -458,18 +454,3 @@ EditorResourcePreview::EditorResourcePreview() {
EditorResourcePreview::~EditorResourcePreview() {
stop();
}
-
-void EditorResourcePreview::update() {
- if (!_mainthread_only) {
- return;
- }
-
- if (!exit.is_set()) {
- // no need to even lock the mutex if the size is zero
- // there is no problem if queue.size() is wrong, even if
- // there was a race condition.
- if (queue.size()) {
- _iterate();
- }
- }
-}
diff --git a/editor/editor_resource_preview.h b/editor/editor_resource_preview.h
index 769340c36f..4e91df8e08 100644
--- a/editor/editor_resource_preview.h
+++ b/editor/editor_resource_preview.h
@@ -81,11 +81,6 @@ class EditorResourcePreview : public Node {
SafeFlag exit;
SafeFlag exited;
- // when running from GLES, we want to run the previews
- // in the main thread using an update, rather than create
- // a separate thread
- bool _mainthread_only = false;
-
struct Item {
Ref<Texture2D> preview;
Ref<Texture2D> small_preview;
@@ -125,9 +120,6 @@ public:
void start();
void stop();
- // for single threaded mode
- void update();
-
EditorResourcePreview();
~EditorResourcePreview();
};