Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CC_RESOURCES_SYNC_POINT_HELPER_H_ | 5 #ifndef CC_RESOURCES_SYNC_POINT_HELPER_H_ |
| 6 #define CC_RESOURCES_SYNC_POINT_HELPER_H_ | 6 #define CC_RESOURCES_SYNC_POINT_HELPER_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "cc/base/cc_export.h" | 9 #include "cc/base/cc_export.h" |
| 10 | 10 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" |
| 11 namespace WebKit { class WebGraphicsContext3D; } | |
| 12 | 11 |
| 13 namespace cc { | 12 namespace cc { |
| 14 | 13 |
| 15 class CC_EXPORT SyncPointHelper { | 14 class CC_EXPORT SyncPointHelper { |
| 16 public: | 15 public: |
| 17 // Requests a callback to |closure| when the |sync_point| is reached by the | 16 // Requests a callback to |closure| when the |sync_point| is reached by the |
| 18 // |context3d|. | 17 // |context3d|. |
| 19 // | 18 // |
| 20 // If the |context3d| is destroyed or lost before the callback fires, then | 19 // If the |context3d| is destroyed or lost before the callback fires, then |
| 21 // AbortBecauseDidLoseOrDestroyContext() must be called to clean up the | 20 // AbortBecauseDidLoseOrDestroyContext() must be called to clean up the |
| 22 // callback's resources. | 21 // callback's resources. |
| 23 static void SignalSyncPoint( | 22 static void SignalSyncPoint( |
| 24 WebKit::WebGraphicsContext3D* context3d, | 23 WebKit::WebGraphicsContext3D* context3d, |
| 25 unsigned sync_point, | 24 unsigned sync_point, |
| 26 const base::Closure& closure); | 25 const base::Closure& closure); |
| 27 | 26 |
| 27 static void SignalQuery( | |
|
danakj
2013/06/17 18:36:48
nit: add a comment here to describe the function?
hubbe
2013/06/17 19:47:19
Done.
| |
| 28 WebKit::WebGraphicsContext3D* context3d, | |
| 29 WebKit::WebGLId query, | |
| 30 const base::Closure& closure); | |
| 31 | |
| 28 private: | 32 private: |
| 29 SyncPointHelper(); | 33 SyncPointHelper(); |
| 30 | 34 |
| 31 DISALLOW_COPY_AND_ASSIGN(SyncPointHelper); | 35 DISALLOW_COPY_AND_ASSIGN(SyncPointHelper); |
| 32 }; | 36 }; |
| 33 | 37 |
| 34 } // namespace cc | 38 } // namespace cc |
| 35 | 39 |
| 36 #endif // CC_RESOURCES_SYNC_POINT_HELPER_H_ | 40 #endif // CC_RESOURCES_SYNC_POINT_HELPER_H_ |
| OLD | NEW |