From 30bc88ccd524c0372fd2f8f79190ea4b81685beb Mon Sep 17 00:00:00 2001 From: kkinnunen Date: Wed, 15 Oct 2014 23:03:54 -0700 Subject: Refactor SkGLContext to be actually extendable Refactor SkGLContext to be actually extendable. Before, non-trivial subclass would need to destroy the GL connection upon running the destructor. However, the base class would run GL commands in its own destructor (with destroyed GL connection) Refactor so that SkGLContext subclass object creation is completely done by the factory function. If the factory function returns a non-NULL ptr, it means the context is usable. The destruction is done with the destructor instead of virtual function called upon destruction. Make the destructors not to call virtual functions, for clarity. Remove custom 1x1 FBO setup code from the base class. It appears not to be used anymore. BUG=skia:2992 Review URL: https://codereview.chromium.org/640283004 --- tools/timer/GpuTimer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools/timer') diff --git a/tools/timer/GpuTimer.cpp b/tools/timer/GpuTimer.cpp index 0fdd999922..51ab3ad235 100644 --- a/tools/timer/GpuTimer.cpp +++ b/tools/timer/GpuTimer.cpp @@ -15,8 +15,8 @@ GpuTimer::GpuTimer(const SkGLContext* glctx) : fContext(glctx) { fContext->makeCurrent(); fStarted = false; fSupported = GrGLGetVersion(fContext->gl()) > GR_GL_VER(3,3) || - fContext->hasExtension("GL_ARB_timer_query") || - fContext->hasExtension("GL_EXT_timer_query"); + fContext->gl()->hasExtension("GL_ARB_timer_query") || + fContext->gl()->hasExtension("GL_EXT_timer_query"); if (fSupported) { SK_GL(*fContext, GenQueries(1, &fQuery)); -- cgit v1.2.3