2011-10-27 20:44:19 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright 2011 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
#ifndef SkNullGLContext_DEFINED
|
|
|
|
#define SkNullGLContext_DEFINED
|
|
|
|
|
2014-10-09 12:24:15 +00:00
|
|
|
#include "SkGLContext.h"
|
2011-10-27 20:44:19 +00:00
|
|
|
|
2014-10-09 12:24:15 +00:00
|
|
|
class SK_API SkNullGLContext : public SkGLContext {
|
2011-10-27 20:44:19 +00:00
|
|
|
public:
|
2014-10-16 06:03:54 +00:00
|
|
|
virtual ~SkNullGLContext() SK_OVERRIDE;
|
2011-10-27 20:44:19 +00:00
|
|
|
virtual void makeCurrent() const SK_OVERRIDE {};
|
2013-10-09 18:25:38 +00:00
|
|
|
virtual void swapBuffers() const SK_OVERRIDE {};
|
|
|
|
|
2014-10-16 06:03:54 +00:00
|
|
|
static SkNullGLContext* Create(GrGLStandard forcedGpuAPI) {
|
|
|
|
if (kGLES_GrGLStandard == forcedGpuAPI) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
SkNullGLContext* ctx = SkNEW(SkNullGLContext);
|
|
|
|
if (!ctx->isValid()) {
|
|
|
|
SkDELETE(ctx);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
return ctx;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
SkNullGLContext();
|
2011-10-27 20:44:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|