1/*
2 * Copyright 2021 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#include "experimental/graphite/src/Buffer.h"
9
10namespace skgpu {
11
12void* Buffer::map() {
13    if (!this->isMapped()) {
14        this->onMap();
15    }
16    return fMapPtr;
17}
18
19void Buffer::unmap() {
20    SkASSERT(this->isMapped());
21    this->onUnmap();
22    fMapPtr = nullptr;
23}
24
25} // namespace skgpu
26
27