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

Unified Diff: gpu/command_buffer/service/mailbox_synchronizer.h

Issue 681713002: Update from chromium https://crrev.com/301315 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 2 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/service/mailbox_synchronizer.h
diff --git a/gpu/command_buffer/service/mailbox_synchronizer.h b/gpu/command_buffer/service/mailbox_synchronizer.h
deleted file mode 100644
index 3ddb9d0f8026ab1bfff8c64a87fb5ff652c23bd0..0000000000000000000000000000000000000000
--- a/gpu/command_buffer/service/mailbox_synchronizer.h
+++ /dev/null
@@ -1,107 +0,0 @@
-// Copyright 2014 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_SERVICE_MAILBOX_SYNCHRONIZER_H_
-#define GPU_COMMAND_BUFFER_SERVICE_MAILBOX_SYNCHRONIZER_H_
-
-#include "gpu/command_buffer/common/mailbox.h"
-
-#include <map>
-#include <queue>
-#include <set>
-
-#include "base/memory/linked_ptr.h"
-#include "base/synchronization/lock.h"
-#include "gpu/command_buffer/service/texture_definition.h"
-#include "gpu/gpu_export.h"
-
-namespace gfx {
-class GLFence;
-}
-
-namespace gpu {
-namespace gles2 {
-
-class MailboxManager;
-class Texture;
-
-// A thread-safe proxy that can be used to emulate texture sharing across
-// share-groups.
-class MailboxSynchronizer {
- public:
- ~MailboxSynchronizer();
-
- GPU_EXPORT static bool Initialize();
- GPU_EXPORT static void Terminate();
- static MailboxSynchronizer* GetInstance();
-
- // Create a texture from a globally visible mailbox.
- Texture* CreateTextureFromMailbox(unsigned target, const Mailbox& mailbox);
-
- void PushTextureUpdates(MailboxManager* manager, uint32 sync_point);
- void PullTextureUpdates(MailboxManager* manager, uint32 sync_point);
-
- void TextureDeleted(Texture* texture);
-
- private:
- MailboxSynchronizer();
-
- struct TargetName {
- TargetName(unsigned target, const Mailbox& mailbox);
- bool operator<(const TargetName& rhs) const {
- return memcmp(this, &rhs, sizeof(rhs)) < 0;
- }
- bool operator!=(const TargetName& rhs) const {
- return memcmp(this, &rhs, sizeof(rhs)) != 0;
- }
- bool operator==(const TargetName& rhs) const {
- return !operator!=(rhs);
- }
- unsigned target;
- Mailbox mailbox;
- };
-
- base::Lock lock_;
-
- struct TextureGroup {
- explicit TextureGroup(const TextureDefinition& definition);
- ~TextureGroup();
-
- TextureDefinition definition;
- std::set<TargetName> mailboxes;
- private:
- DISALLOW_COPY_AND_ASSIGN(TextureGroup);
- };
-
- struct TextureVersion {
- explicit TextureVersion(linked_ptr<TextureGroup> group);
- ~TextureVersion();
-
- unsigned int version;
- linked_ptr<TextureGroup> group;
- };
- typedef std::map<Texture*, TextureVersion> TextureMap;
- TextureMap textures_;
-
- linked_ptr<TextureGroup> GetGroupForMailboxLocked(
- const TargetName& target_name);
- void ReassociateMailboxLocked(
- const TargetName& target_name,
- TextureGroup* group);
- void UpdateTextureLocked(Texture* texture, TextureVersion& texture_version);
- void CreateFenceLocked(uint32 sync_point);
- void AcquireFenceLocked(uint32 sync_point);
-
- typedef std::map<uint32, linked_ptr<gfx::GLFence> > SyncPointToFenceMap;
- SyncPointToFenceMap sync_point_to_fence_;
- std::queue<SyncPointToFenceMap::iterator> sync_points_;
-
- DISALLOW_COPY_AND_ASSIGN(MailboxSynchronizer);
-};
-
-} // namespage gles2
-} // namespace gpu
-
-#endif // GPU_COMMAND_BUFFER_SERVICE_MAILBOX_SYNCHRONIZER_H_
-
« no previous file with comments | « gpu/command_buffer/service/mailbox_manager_unittest.cc ('k') | gpu/command_buffer/service/mailbox_synchronizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698