aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/SkNullGLContext.cpp
blob: 95b0e5ef47d93aa358116c4ea7ffbad7925b5b14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

/*
 * Copyright 2011 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include "gl/SkNullGLContext.h"
#include "gl/GrGLInterface.h"

SkNullGLContext* SkNullGLContext::Create() {
    SkNullGLContext* ctx = new SkNullGLContext;
    if (!ctx->isValid()) {
        delete ctx;
        return nullptr;
    }
    return ctx;
}

SkNullGLContext::SkNullGLContext() {
    this->init(GrGLCreateNullInterface());
}

SkNullGLContext::~SkNullGLContext() {
    this->teardown();
}