blob: 3de31a581f68a8f3e06488193ea8bb21ebf698cb [file] [log] [blame]
Brian Salomon63a0a752020-06-26 13:32:09 -04001/*
2 * Copyright 2020 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 "include/core/SkRefCnt.h"
9#include "include/gpu/GrTypes.h"
10
Adlai Holler29405382020-07-20 16:02:05 -040011class GrDirectContext;
Brian Salomon63a0a752020-06-26 13:32:09 -040012class SkImage;
13class SkPixmap;
14
15namespace sk_gpu_test {
16/**
17 * Creates a backend texture with pixmap contents and wraps it in a SkImage that safely deletes
18 * the texture when it goes away. Unlike using makeTextureImage() on a non-GPU image, this will
19 * fail rather than fallback if the pixmaps's color type doesn't map to a supported texture format.
20 * For testing purposes the texture can be made renderable to exercise different code paths for
21 * renderable textures/formats.
22 */
Adlai Holler29405382020-07-20 16:02:05 -040023sk_sp<SkImage> MakeBackendTextureImage(GrDirectContext*, const SkPixmap&,
24 GrRenderable, GrSurfaceOrigin);
Brian Salomon63a0a752020-06-26 13:32:09 -040025} // namespace sk_gpu_test