From 3d6801eeee6b036de9f8d09e2ae8fa99df5a397c Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Mon, 11 Dec 2017 10:06:31 -0500 Subject: Add GrGLMakeNativeInterface factory that returns sk_sp. Removes the concept of a configurable "default" interface and makes the default always be the "native" interface. Also removes unused functions: GrGLInterfaceAddTestDebugMarker and GrGLInterface::NewClone. Keeps around legacy GrGLCreateNativeInterface() until clients can be weened. Change-Id: I4a3bdafa8cf8c68ed13318393abd55686b045ccb Reviewed-on: https://skia-review.googlesource.com/83000 Reviewed-by: Robert Phillips Commit-Queue: Brian Salomon --- tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp') diff --git a/tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp b/tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp index be2b6ad5e6..1924257be7 100644 --- a/tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp +++ b/tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp @@ -130,7 +130,7 @@ static void load_command_buffer_once() { once(load_command_buffer_functions); } -static const GrGLInterface* create_command_buffer_interface() { +static sk_sp create_command_buffer_interface() { load_command_buffer_once(); if (!gfFunctionsLoadedSuccessfully) { return nullptr; @@ -289,8 +289,8 @@ CommandBufferGLTestContext::CommandBufferGLTestContext(CommandBufferGLTestContex return; } - sk_sp gl(create_command_buffer_interface()); - if (nullptr == gl.get()) { + auto gl = create_command_buffer_interface(); + if (!gl) { SkDebugf("Command Buffer: Could not create CommandBuffer GL interface.\n"); this->destroyGLContext(); return; @@ -301,7 +301,7 @@ CommandBufferGLTestContext::CommandBufferGLTestContext(CommandBufferGLTestContex return; } - this->init(gl.release()); + this->init(std::move(gl)); } CommandBufferGLTestContext::~CommandBufferGLTestContext() { -- cgit v1.2.3