Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Unified Diff: gpu/command_buffer/client/scoped_visibility_impl.h

Issue 2252163003: Update Context Client Visibility to use Scoped Pattern (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/client/scoped_visibility_impl.h
diff --git a/gpu/command_buffer/client/scoped_visibility_impl.h b/gpu/command_buffer/client/scoped_visibility_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..fc5f9dd7e9b9512a5156974308b683cb1a00c527
--- /dev/null
+++ b/gpu/command_buffer/client/scoped_visibility_impl.h
@@ -0,0 +1,30 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef GPU_COMMAND_BUFFER_CLIENT_SCOPED_VISIBILITY_IMPL_H_
+#define GPU_COMMAND_BUFFER_CLIENT_SCOPED_VISIBILITY_IMPL_H_
+
+#include <memory>
+
+#include "gpu/command_buffer/client/context_support.h"
+#include "gpu/gpu_export.h"
+
+namespace gpu {
+
+class GPU_EXPORT ScopedVisibilityImpl
+ : public ContextSupport::ScopedVisibility {
+ public:
+ explicit ScopedVisibilityImpl(ContextSupport* context_support);
+ ~ScopedVisibilityImpl();
+ void Release(ContextSupport* context_support);
+
+ private:
+ // |initial_context_support_| is just stored/used for sanity-checking Release.
+ const ContextSupport* const initial_context_support_;
+ bool released_;
+};
+
+} // namespace gpu
+
+#endif // GPU_COMMAND_BUFFER_CLIENT_SCOPED_VISIBILITY_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698