forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose Signal(Query|SyncPoint) via gpu::ContextSupport* instead of WGC3D
This exposes calls to register queries and sync points with callbacks by a new gpu::ContextSupport interface intended to be used directly by clients who need this functionality like the compositor instead of having to go through WebKit::WebGraphicsContext3D. These calls aren't 'proper' OpenGL as OpenGL doesn't have any notion of callbacks, but are still useful with our OpenGL implementation. This also unifies the multiple implementations of these functions a bit. In particular, now both the in-process and out-of-process contexts check if the context is lost before dispatching SyncPoint/Query callbacks. Previously only the in-process implementation did this. R=piman,sievers BUG=181120 Review URL: https://codereview.chromium.org/26164003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@230043 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
jamesr@chromium.org
committed
Oct 22, 2013
1 parent
b255a8e
commit 6ffaaf3
Showing
40 changed files
with
306 additions
and
285 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright 2013 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. | ||
|
||
#include "cc/debug/test_context_support.h" | ||
|
||
#include "base/message_loop/message_loop.h" | ||
|
||
namespace cc { | ||
|
||
TestContextSupport::TestContextSupport() {} | ||
TestContextSupport::~TestContextSupport() {} | ||
|
||
void TestContextSupport::SignalSyncPoint(uint32 sync_point, | ||
const base::Closure& callback) { | ||
sync_point_callbacks_.push_back(callback); | ||
} | ||
|
||
void TestContextSupport::SignalQuery(uint32 query, | ||
const base::Closure& callback) { | ||
sync_point_callbacks_.push_back(callback); | ||
} | ||
|
||
void TestContextSupport::CallAllSyncPointCallbacks() { | ||
for (size_t i = 0; i < sync_point_callbacks_.size(); ++i) { | ||
base::MessageLoop::current()->PostTask( | ||
FROM_HERE, sync_point_callbacks_[i]); | ||
} | ||
sync_point_callbacks_.clear(); | ||
} | ||
|
||
} // namespace cc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright 2013 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 CC_DEBUG_TEST_CONTEXT_SUPPORT_H_ | ||
#define CC_DEBUG_TEST_CONTEXT_SUPPORT_H_ | ||
|
||
#include <vector> | ||
|
||
#include "gpu/command_buffer/client/context_support.h" | ||
|
||
namespace cc { | ||
|
||
class TestContextSupport : public gpu::ContextSupport { | ||
public: | ||
TestContextSupport(); | ||
virtual ~TestContextSupport(); | ||
|
||
// gpu::ContextSupport implementation. | ||
virtual void SignalSyncPoint(uint32 sync_point, | ||
const base::Closure& callback) OVERRIDE; | ||
virtual void SignalQuery(uint32 query, | ||
const base::Closure& callback) OVERRIDE; | ||
|
||
void CallAllSyncPointCallbacks(); | ||
|
||
private: | ||
std::vector<base::Closure> sync_point_callbacks_; | ||
|
||
DISALLOW_COPY_AND_ASSIGN(TestContextSupport); | ||
}; | ||
|
||
} // namespace cc | ||
|
||
#endif // CC_DEBUG_TEST_CONTEXT_SUPPORT_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.