2020-06-26 17:32:09 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2020 Google LLC
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "include/core/SkRefCnt.h"
|
|
|
|
#include "include/gpu/GrTypes.h"
|
|
|
|
|
2020-07-20 20:02:05 +00:00
|
|
|
class GrDirectContext;
|
2020-06-26 17:32:09 +00:00
|
|
|
class SkImage;
|
|
|
|
class SkPixmap;
|
|
|
|
|
|
|
|
namespace sk_gpu_test {
|
|
|
|
/**
|
|
|
|
* Creates a backend texture with pixmap contents and wraps it in a SkImage that safely deletes
|
|
|
|
* the texture when it goes away. Unlike using makeTextureImage() on a non-GPU image, this will
|
|
|
|
* fail rather than fallback if the pixmaps's color type doesn't map to a supported texture format.
|
|
|
|
* For testing purposes the texture can be made renderable to exercise different code paths for
|
|
|
|
* renderable textures/formats.
|
|
|
|
*/
|
2020-10-12 21:30:00 +00:00
|
|
|
sk_sp<SkImage> MakeBackendTextureImage(GrDirectContext*, const SkPixmap&,
|
|
|
|
GrRenderable, GrSurfaceOrigin);
|
2020-06-26 17:32:09 +00:00
|
|
|
} // namespace sk_gpu_test
|