1 /* 2 * Copyright 2022 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 #ifndef skgpu_graphite_TextureUtils_DEFINED 9 #define skgpu_graphite_TextureUtils_DEFINED 10 11 #include "include/core/SkImage.h" 12 #include "src/gpu/graphite/TextureProxyView.h" 13 14 #include <functional> 15 16 class SkBitmap; 17 enum SkColorType : int; 18 struct SkImageInfo; 19 20 namespace skgpu::graphite { 21 22 class Context; 23 24 // Create TextureProxyView and SkColorType pair using pixel data in SkBitmap, 25 // adding any necessary copy commands to Recorder 26 std::tuple<TextureProxyView, SkColorType> MakeBitmapProxyView( 27 Recorder*, const SkBitmap&, sk_sp<SkMipmap>, Mipmapped, skgpu::Budgeted); 28 29 sk_sp<SkImage> MakeFromBitmap(Recorder*, 30 const SkColorInfo&, 31 const SkBitmap&, 32 sk_sp<SkMipmap>, 33 skgpu::Budgeted, 34 SkImage::RequiredImageProperties); 35 } // namespace skgpu::graphite 36 37 #endif // skgpu_graphite_TextureUtils_DEFINED 38