Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CC_RESOURCES_SYNC_POINT_HELPER_H_ | |
| 6 #define CC_RESOURCES_SYNC_POINT_HELPER_H_ | |
| 7 | |
| 8 #include "base/callback.h" | |
| 9 #include "base/memory/ref_counted.h" | |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "cc/base/cc_export.h" | |
| 12 | |
| 13 namespace WebKit { class WebGraphicsContext3D; } | |
| 14 | |
| 15 namespace cc { | |
| 16 class SignalSyncPointCallbackClass; | |
| 17 | |
| 18 class CC_EXPORT SyncPointHelper { | |
| 19 public: | |
| 20 // Requests a callback to |closure| when the |sync_point| is reached by the | |
| 21 // |context3d|. If the SyncPointHelper* returned is destroyed, the callback | |
| 22 // request will be aborted. | |
| 23 // | |
| 24 // The returned pointer must be kept alive until either |closure| is called or | |
| 25 // 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
| |
| 26 static scoped_ptr<SyncPointHelper> SignalSyncPoint( | |
| 27 WebKit::WebGraphicsContext3D* context3d, | |
| 28 unsigned sync_point, | |
| 29 const base::Closure& closure); | |
| 30 | |
| 31 ~SyncPointHelper(); | |
| 32 | |
| 33 private: | |
| 34 SyncPointHelper(scoped_ptr<SignalSyncPointCallbackClass> callback_class); | |
| 35 | |
| 36 scoped_ptr<SignalSyncPointCallbackClass> callback_class_; | |
| 37 | |
| 38 DISALLOW_COPY_AND_ASSIGN(SyncPointHelper); | |
| 39 }; | |
| 40 | |
| 41 } // namespace cc | |
| 42 | |
| 43 #endif // CC_RESOURCES_SYNC_POINT_HELPER_H_ | |
| OLD | NEW |