skia2/tools/gpu/BackendSurfaceFactory.h
Brian Salomon f9b0042423 Expose ManagedBackendTexture from BackendTextureImageFactory.
Add helper to create self-managed BackendTexture-backed SkSurface for
tests using MBET.

GrGpu::createTestingOnlyBackendRenderTarget supports protected.

Make SkSurfaceCharacterization tests use self-managed SkSurface
factories and a use case of MakeFromBackendTextureAsRenderTarget is
removed.

Use self-managed BackendTexture-backed SkSurface factory in DM sinks and
in fm.

Bug: skia:9832

Change-Id: I0c1dc49697f8b3c942864e18b9112a3552f431ba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323559
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-10-08 20:35:32 +00:00

44 lines
1.6 KiB
C++

/*
* Copyright 2020 Google LLC
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef TestSurface_DEFINED
#define TestSurface_DEFINED
#include "include/core/SkImageInfo.h"
#include "include/core/SkSize.h"
#include "include/gpu/GrTypes.h"
#include "include/private/SkColorData.h"
class GrDirectContext;
class SkSurface;
class SkSurfaceProps;
namespace sk_gpu_test {
sk_sp<SkSurface> MakeBackendTextureSurface(GrDirectContext*,
SkISize,
GrSurfaceOrigin,
int sampleCnt,
SkColorType,
sk_sp<SkColorSpace> = nullptr,
GrMipmapped = GrMipmapped::kNo,
GrProtected = GrProtected::kNo,
const SkSurfaceProps* = nullptr);
/** Creates an SkSurface backed by a non-textureable render target. */
sk_sp<SkSurface> MakeBackendRenderTargetSurface(GrDirectContext*,
SkISize,
GrSurfaceOrigin,
int sampleCnt,
SkColorType,
sk_sp<SkColorSpace> = nullptr,
GrProtected = GrProtected::kNo,
const SkSurfaceProps* = nullptr);
} // namespace sk_gpu_test
#endif