Use ManagedBackendTexture in place of TestUtils backend texture helpers.
Unify on a single family of helpers for making backend textures.
Stresses callback systems in more tests by avoiding artificial
flush/submit/syncs.
some misc test cleanup along the way.
Change-Id: Ia692e8927ba97b391ee77ea06ebf437a555617b2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324710
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
diff --git a/tools/gpu/BackendTextureImageFactory.h b/tools/gpu/BackendTextureImageFactory.h
index 3de31a5..289f268 100644
--- a/tools/gpu/BackendTextureImageFactory.h
+++ b/tools/gpu/BackendTextureImageFactory.h
@@ -5,12 +5,15 @@
* found in the LICENSE file.
*/
+#include "include/core/SkColor.h"
#include "include/core/SkRefCnt.h"
#include "include/gpu/GrTypes.h"
class GrDirectContext;
+class SkColorSpace;
class SkImage;
class SkPixmap;
+struct SkISize;
namespace sk_gpu_test {
/**
@@ -20,6 +23,17 @@
* For testing purposes the texture can be made renderable to exercise different code paths for
* renderable textures/formats.
*/
-sk_sp<SkImage> MakeBackendTextureImage(GrDirectContext*, const SkPixmap&,
- GrRenderable, GrSurfaceOrigin);
+sk_sp<SkImage> MakeBackendTextureImage(GrDirectContext*,
+ const SkPixmap&,
+ GrRenderable,
+ GrSurfaceOrigin);
+
+/** Creates an image of with a solid color. */
+sk_sp<SkImage> MakeBackendTextureImage(GrDirectContext*,
+ const SkImageInfo& info,
+ SkColor4f,
+ GrMipmapped = GrMipmapped::kNo,
+ GrRenderable = GrRenderable::kNo,
+ GrSurfaceOrigin = GrSurfaceOrigin::kTopLeft_GrSurfaceOrigin);
+
} // namespace sk_gpu_test