2 * Copyright 2020 Google LLC
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
8 #include "include/core/SkColor.h"
9 #include "include/core/SkImageInfo.h"
10 #include "include/core/SkRefCnt.h"
11 #include "include/gpu/GrTypes.h"
13 class GrDirectContext;
19 namespace sk_gpu_test {
21 * Creates a backend texture with pixmap contents and wraps it in a SkImage that safely deletes
22 * the texture when it goes away. Unlike using makeTextureImage() on a non-GPU image, this will
23 * fail rather than fallback if the pixmaps's color type doesn't map to a supported texture format.
24 * For testing purposes the texture can be made renderable to exercise different code paths for
25 * renderable textures/formats.
27 sk_sp<SkImage> MakeBackendTextureImage(GrDirectContext*,
32 /** Creates an image of with a solid color. */
33 sk_sp<SkImage> MakeBackendTextureImage(GrDirectContext*,
34 const SkImageInfo& info,
36 GrMipmapped = GrMipmapped::kNo,
37 GrRenderable = GrRenderable::kNo,
38 GrSurfaceOrigin = GrSurfaceOrigin::kTopLeft_GrSurfaceOrigin);
40 } // namespace sk_gpu_test