1 /*
2 * Copyright 2021 Google LLC
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/Texture.h"
9
10 #include "src/gpu/MutableTextureStateRef.h"
11 #include "src/gpu/RefCntedCallback.h"
12
13 namespace skgpu::graphite {
14
Texture(const SharedContext * sharedContext,SkISize dimensions,const TextureInfo & info,sk_sp<MutableTextureStateRef> mutableState,Ownership ownership,skgpu::Budgeted budgeted)15 Texture::Texture(const SharedContext* sharedContext,
16 SkISize dimensions,
17 const TextureInfo& info,
18 sk_sp<MutableTextureStateRef> mutableState,
19 Ownership ownership,
20 skgpu::Budgeted budgeted)
21 : Resource(sharedContext, ownership, budgeted)
22 , fDimensions(dimensions)
23 , fInfo(info)
24 , fMutableState(std::move(mutableState)) {}
25
~Texture()26 Texture::~Texture() {}
27
setReleaseCallback(sk_sp<RefCntedCallback> releaseCallback)28 void Texture::setReleaseCallback(sk_sp<RefCntedCallback> releaseCallback) {
29 fReleaseCallback = std::move(releaseCallback);
30 }
31
mutableState() const32 MutableTextureStateRef* Texture::mutableState() const { return fMutableState.get(); }
33
34 } // namespace skgpu::graphite
35