From 145dbcd165d9d27298eb8888bc240e2d06a95464 Mon Sep 17 00:00:00 2001 From: Ben Wagner Date: Thu, 3 Nov 2016 14:40:50 -0400 Subject: Remove SkAutoTDelete. Replace with std::unique_ptr. Change-Id: I5806cfbb30515fcb20e5e66ce13fb5f3b8728176 Reviewed-on: https://skia-review.googlesource.com/4381 Commit-Queue: Ben Wagner Reviewed-by: Mike Klein --- tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tools/gpu/gl/egl') diff --git a/tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp b/tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp index 06bd70f852..b2517f090e 100644 --- a/tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp +++ b/tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp @@ -22,7 +22,7 @@ namespace { // TODO: Share this class with ANGLE if/when it gets support for EGL_KHR_fence_sync. class EGLFenceSync : public sk_gpu_test::FenceSync { public: - static EGLFenceSync* CreateIfSupported(EGLDisplay); + static std::unique_ptr MakeIfSupported(EGLDisplay); sk_gpu_test::PlatformFence SK_WARN_UNUSED_RESULT insertFence() const override; bool waitFence(sk_gpu_test::PlatformFence fence) const override; @@ -44,7 +44,7 @@ public: GrEGLImage texture2DToEGLImage(GrGLuint texID) const override; void destroyEGLImage(GrEGLImage) const override; GrGLuint eglImageToExternalTexture(GrEGLImage) const override; - sk_gpu_test::GLTestContext* createNew() const override; + std::unique_ptr makeNew() const override; private: void destroyGLContext(); @@ -180,7 +180,7 @@ EGLGLTestContext::EGLGLTestContext(GrGLStandard forcedGpuAPI) continue; } - this->init(gl.release(), EGLFenceSync::CreateIfSupported(fDisplay)); + this->init(gl.release(), EGLFenceSync::MakeIfSupported(fDisplay)); break; } } @@ -255,8 +255,8 @@ GrGLuint EGLGLTestContext::eglImageToExternalTexture(GrEGLImage image) const { return texID; } -sk_gpu_test::GLTestContext* EGLGLTestContext::createNew() const { - sk_gpu_test::GLTestContext* ctx = new EGLGLTestContext(this->gl()->fStandard); +std::unique_ptr EGLGLTestContext::makeNew() const { + std::unique_ptr ctx(new EGLGLTestContext(this->gl()->fStandard)); if (ctx) { ctx->makeCurrent(); } @@ -294,11 +294,11 @@ static bool supports_egl_extension(EGLDisplay display, const char* extension) { return false; } -EGLFenceSync* EGLFenceSync::CreateIfSupported(EGLDisplay display) { +std::unique_ptr EGLFenceSync::MakeIfSupported(EGLDisplay display) { if (!display || !supports_egl_extension(display, "EGL_KHR_fence_sync")) { return nullptr; } - return new EGLFenceSync(display); + return std::unique_ptr(new EGLFenceSync(display)); } sk_gpu_test::PlatformFence EGLFenceSync::insertFence() const { -- cgit v1.2.3