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

Unified Diff: tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp

Issue 2383383002: Move GPU fences into sk_gpu_test (Closed)
Patch Set: Move GPU fences into sk_gpu_test Created 4 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: tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp
diff --git a/tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp b/tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp
index edbc63200bba04fcaa14460a4870bb0575c1145d..de5f20da8f99bc38e966f760660e1faf08b0d632 100644
--- a/tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp
+++ b/tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp
@@ -17,23 +17,23 @@
#include "gl/GrGLDefines.h"
#include "gl/GrGLUtil.h"
-namespace {
+namespace sk_gpu_test {
bsalomon 2016/10/03 17:54:00 Can't this still be in an anonymous namespace?
csmartdalton 2016/10/03 19:05:40 Done.
// TODO: Share this class with ANGLE if/when it gets support for EGL_KHR_fence_sync.
-class EGLFenceSync : public SkGpuFenceSync {
+class EGLFenceSync : public FenceSync {
public:
static EGLFenceSync* CreateIfSupported(EGLDisplay);
- SkPlatformGpuFence SK_WARN_UNUSED_RESULT insertFence() const override;
- bool waitFence(SkPlatformGpuFence fence) const override;
- void deleteFence(SkPlatformGpuFence fence) const override;
+ PlatformFence SK_WARN_UNUSED_RESULT insertFence() const override;
+ bool waitFence(PlatformFence fence) const override;
+ void deleteFence(PlatformFence fence) const override;
private:
EGLFenceSync(EGLDisplay display) : fDisplay(display) {}
EGLDisplay fDisplay;
- typedef SkGpuFenceSync INHERITED;
+ typedef FenceSync INHERITED;
};
class EGLGLTestContext : public sk_gpu_test::GLTestContext {
@@ -301,12 +301,12 @@ EGLFenceSync* EGLFenceSync::CreateIfSupported(EGLDisplay display) {
return new EGLFenceSync(display);
}
-SkPlatformGpuFence EGLFenceSync::insertFence() const {
- return eglCreateSyncKHR(fDisplay, EGL_SYNC_FENCE_KHR, nullptr);
+PlatformFence EGLFenceSync::insertFence() const {
+ return reinterpret_cast<PlatformFence>(eglCreateSyncKHR(fDisplay, EGL_SYNC_FENCE_KHR, nullptr));
}
-bool EGLFenceSync::waitFence(SkPlatformGpuFence platformFence) const {
- EGLSyncKHR eglsync = static_cast<EGLSyncKHR>(platformFence);
+bool EGLFenceSync::waitFence(PlatformFence platformFence) const {
+ EGLSyncKHR eglsync = reinterpret_cast<EGLSyncKHR>(platformFence);
return EGL_CONDITION_SATISFIED_KHR ==
eglClientWaitSyncKHR(fDisplay,
eglsync,
@@ -314,14 +314,11 @@ bool EGLFenceSync::waitFence(SkPlatformGpuFence platformFence) const {
EGL_FOREVER_KHR);
}
-void EGLFenceSync::deleteFence(SkPlatformGpuFence platformFence) const {
- EGLSyncKHR eglsync = static_cast<EGLSyncKHR>(platformFence);
+void EGLFenceSync::deleteFence(PlatformFence platformFence) const {
+ EGLSyncKHR eglsync = reinterpret_cast<EGLSyncKHR>(platformFence);
eglDestroySyncKHR(fDisplay, eglsync);
}
-} // anonymous namespace
-
-namespace sk_gpu_test {
GLTestContext *CreatePlatformGLTestContext(GrGLStandard forcedGpuAPI,
GLTestContext *shareContext) {
SkASSERT(!shareContext);

Powered by Google App Engine
This is Rietveld 408576698