Chromium Code Reviews| Index: cc/resources/sync_point_helper.h |
| diff --git a/cc/resources/sync_point_helper.h b/cc/resources/sync_point_helper.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c42fb1113466b8e518920c3d6ca5f68a91ca2e72 |
| --- /dev/null |
| +++ b/cc/resources/sync_point_helper.h |
| @@ -0,0 +1,43 @@ |
| +// 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_RESOURCES_SYNC_POINT_HELPER_H_ |
| +#define CC_RESOURCES_SYNC_POINT_HELPER_H_ |
| + |
| +#include "base/callback.h" |
| +#include "base/memory/ref_counted.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "cc/base/cc_export.h" |
| + |
| +namespace WebKit { class WebGraphicsContext3D; } |
| + |
| +namespace cc { |
| +class SignalSyncPointCallbackClass; |
| + |
| +class CC_EXPORT SyncPointHelper { |
| + public: |
| + // Requests a callback to |closure| when the |sync_point| is reached by the |
| + // |context3d|. If the SyncPointHelper* returned is destroyed, the callback |
| + // request will be aborted. |
| + // |
| + // The returned pointer must be kept alive until either |closure| is called or |
| + // the |context3d| is destroyed. |
|
piman
2013/04/26 01:20:52
Could we make WGC3D::signalSyncPoint take ownershi
danakj
2013/04/26 01:39:30
That was my original plan but if the context is de
|
| + static scoped_ptr<SyncPointHelper> SignalSyncPoint( |
| + WebKit::WebGraphicsContext3D* context3d, |
| + unsigned sync_point, |
| + const base::Closure& closure); |
| + |
| + ~SyncPointHelper(); |
| + |
| + private: |
| + SyncPointHelper(scoped_ptr<SignalSyncPointCallbackClass> callback_class); |
| + |
| + scoped_ptr<SignalSyncPointCallbackClass> callback_class_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(SyncPointHelper); |
| +}; |
| + |
| +} // namespace cc |
| + |
| +#endif // CC_RESOURCES_SYNC_POINT_HELPER_H_ |