Coverage Report

Created: 2024-09-14 07:19

/src/skia/src/gpu/graphite/Buffer.cpp
Line
Count
Source (jump to first uncovered line)
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 "src/gpu/graphite/Buffer.h"
9
#include "src/gpu/graphite/Caps.h"
10
#include "src/gpu/graphite/SharedContext.h"
11
12
namespace skgpu::graphite {
13
14
0
void* Buffer::map() {
15
0
    SkASSERT(this->isUnmappable() || !this->sharedContext()->caps()->bufferMapsAreAsync());
16
0
    if (!this->isMapped()) {
17
0
        this->onMap();
18
0
    }
19
0
    return fMapPtr;
20
0
}
Unexecuted instantiation: skgpu::graphite::Buffer::map()
Unexecuted instantiation: skgpu::graphite::Buffer::map()
21
22
0
void Buffer::asyncMap(GpuFinishedProc proc, GpuFinishedContext ctx) {
23
0
    SkASSERT(this->sharedContext()->caps()->bufferMapsAreAsync());
24
0
    this->onAsyncMap(proc, ctx);
25
0
}
Unexecuted instantiation: skgpu::graphite::Buffer::asyncMap(void (*)(void*, skgpu::CallbackResult), void*)
Unexecuted instantiation: skgpu::graphite::Buffer::asyncMap(void (*)(void*, skgpu::CallbackResult), void*)
26
27
0
void Buffer::unmap() {
28
0
    SkASSERT(this->isUnmappable());
29
0
    this->onUnmap();
30
0
    fMapPtr = nullptr;
31
0
}
Unexecuted instantiation: skgpu::graphite::Buffer::unmap()
Unexecuted instantiation: skgpu::graphite::Buffer::unmap()
32
33
0
bool Buffer::isUnmappable() const { return isMapped(); }
34
35
0
void Buffer::onAsyncMap(skgpu::graphite::GpuFinishedProc, skgpu::graphite::GpuFinishedContext) {
36
0
    SkASSERT(!this->sharedContext()->caps()->bufferMapsAreAsync());
37
0
    SK_ABORT("Async buffer mapping not supported");
38
0
}
Unexecuted instantiation: skgpu::graphite::Buffer::onAsyncMap(void (*)(void*, skgpu::CallbackResult), void*)
Unexecuted instantiation: skgpu::graphite::Buffer::onAsyncMap(void (*)(void*, skgpu::CallbackResult), void*)
39
40
} // namespace skgpu::graphite
41