aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/mock/GrMockBuffer.h
blob: fdb812d30d33f64f26f073042dd4864cff662442 (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
28
29
30
/*
 * Copyright 2017 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef GrMockBuffer_DEFINED
#define GrMockBuffer_DEFINED

#include "GrBuffer.h"
#include "GrMockGpu.h"

class GrMockBuffer : public GrBuffer {
public:
    GrMockBuffer(GrMockGpu* gpu, size_t sizeInBytes, GrBufferType type,
                 GrAccessPattern accessPattern)
            : INHERITED(gpu, sizeInBytes, type, accessPattern) {
        this->registerWithCache(SkBudgeted::kYes);
    }

private:
    void onMap() override {}
    void onUnmap() override {}
    bool onUpdateData(const void* src, size_t srcSizeInBytes) override { return true; }

    typedef GrBuffer INHERITED;
};

#endif