Project import generated by Copybara.
GitOrigin-RevId: 852dfb05d450167899c0dd5ef7c45622a12e865b
This commit is contained in:
committed by
Hadon Nash
parent
d144e564d8
commit
de4fbc10e6
@@ -920,6 +920,7 @@ objc_library(
|
||||
ios_unit_test(
|
||||
name = "gl_ios_test",
|
||||
minimum_os_version = MIN_IOS_VERSION,
|
||||
runner = "//googlemac/iPhone/Shared/Testing/EarlGrey/Runner:IOS_LATEST",
|
||||
tags = [
|
||||
"ios",
|
||||
],
|
||||
|
||||
@@ -29,9 +29,9 @@ struct EglSurfaceHolder {
|
||||
// GlCalculatorHelper::RunInGlContext while holding this mutex, but instead
|
||||
// grab this inside the callable passed to them.
|
||||
absl::Mutex mutex;
|
||||
EGLSurface surface GUARDED_BY(mutex) = EGL_NO_SURFACE;
|
||||
EGLSurface surface ABSL_GUARDED_BY(mutex) = EGL_NO_SURFACE;
|
||||
// True if MediaPipe created the surface and is responsible for destroying it.
|
||||
bool owned GUARDED_BY(mutex) = false;
|
||||
bool owned ABSL_GUARDED_BY(mutex) = false;
|
||||
// Vertical flip of the surface, useful for conversion between coordinate
|
||||
// systems with top-left v.s. bottom-left origins.
|
||||
bool flip_y = false;
|
||||
|
||||
@@ -346,7 +346,7 @@ std::weak_ptr<GlContext>& GlContext::CurrentContext() {
|
||||
|
||||
::mediapipe::Status GlContext::SwitchContext(ContextBinding* saved_context,
|
||||
const ContextBinding& new_context)
|
||||
NO_THREAD_SAFETY_ANALYSIS {
|
||||
ABSL_NO_THREAD_SAFETY_ANALYSIS {
|
||||
std::shared_ptr<GlContext> old_context_obj = CurrentContext().lock();
|
||||
std::shared_ptr<GlContext> new_context_obj =
|
||||
new_context.context_object.lock();
|
||||
|
||||
@@ -379,7 +379,7 @@ class GlContext : public std::enable_shared_from_this<GlContext> {
|
||||
// This mutex is used to guard a few different members and condition
|
||||
// variables. It should only be held for a short time.
|
||||
absl::Mutex mutex_;
|
||||
absl::CondVar wait_for_gl_finish_cv_ GUARDED_BY(mutex_);
|
||||
absl::CondVar wait_for_gl_finish_cv_ ABSL_GUARDED_BY(mutex_);
|
||||
|
||||
std::unique_ptr<mediapipe::GlProfilingHelper> profiling_helper_ = nullptr;
|
||||
};
|
||||
|
||||
@@ -52,11 +52,11 @@ class GlContext::DedicatedThread {
|
||||
|
||||
absl::Mutex mutex_;
|
||||
// Used to wait for a job's completion.
|
||||
absl::CondVar gl_job_done_cv_ GUARDED_BY(mutex_);
|
||||
absl::CondVar gl_job_done_cv_ ABSL_GUARDED_BY(mutex_);
|
||||
pthread_t gl_thread_id_;
|
||||
|
||||
std::deque<Job> jobs_ GUARDED_BY(mutex_);
|
||||
absl::CondVar has_jobs_cv_ GUARDED_BY(mutex_);
|
||||
std::deque<Job> jobs_ ABSL_GUARDED_BY(mutex_);
|
||||
absl::CondVar has_jobs_cv_ ABSL_GUARDED_BY(mutex_);
|
||||
|
||||
bool self_destruct_ = false;
|
||||
};
|
||||
|
||||
@@ -60,7 +60,7 @@ class GlTextureBufferPool
|
||||
|
||||
// If the total number of buffers is greater than keep_count, destroys any
|
||||
// surplus buffers that are no longer in use.
|
||||
void TrimAvailable() EXCLUSIVE_LOCKS_REQUIRED(mutex_);
|
||||
void TrimAvailable() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
|
||||
|
||||
const int width_;
|
||||
const int height_;
|
||||
@@ -68,8 +68,9 @@ class GlTextureBufferPool
|
||||
const int keep_count_;
|
||||
|
||||
absl::Mutex mutex_;
|
||||
int in_use_count_ GUARDED_BY(mutex_) = 0;
|
||||
std::vector<std::unique_ptr<GlTextureBuffer>> available_ GUARDED_BY(mutex_);
|
||||
int in_use_count_ ABSL_GUARDED_BY(mutex_) = 0;
|
||||
std::vector<std::unique_ptr<GlTextureBuffer>> available_
|
||||
ABSL_GUARDED_BY(mutex_);
|
||||
};
|
||||
|
||||
} // namespace mediapipe
|
||||
|
||||
@@ -61,7 +61,7 @@ class GlThreadCollector {
|
||||
}
|
||||
|
||||
absl::Mutex mutex_;
|
||||
int active_threads_ GUARDED_BY(mutex_) = 0;
|
||||
int active_threads_ ABSL_GUARDED_BY(mutex_) = 0;
|
||||
friend NoDestructor<GlThreadCollector>;
|
||||
};
|
||||
#else
|
||||
|
||||
@@ -107,7 +107,7 @@ class GpuBufferMultiPool {
|
||||
|
||||
absl::Mutex mutex_;
|
||||
std::unordered_map<BufferSpec, SimplePool, BufferSpecHash> pools_
|
||||
GUARDED_BY(mutex_);
|
||||
ABSL_GUARDED_BY(mutex_);
|
||||
// A queue of BufferSpecs to keep track of the age of each BufferSpec added to
|
||||
// the pool.
|
||||
std::queue<BufferSpec> buffer_specs_;
|
||||
|
||||
Reference in New Issue
Block a user