Make color initialization version of createBackendTexture public

Mechanical.

Change-Id: I48be78a12684fc5243ee509e391984daa190fb7d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218182
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This commit is contained in:
Robert Phillips 2019-06-04 11:03:06 -04:00 committed by Skia Commit-Bot
parent a4bb020636
commit 4bdd36f625
24 changed files with 151 additions and 151 deletions

View File

@ -1388,7 +1388,7 @@ Error GPUSink::onDraw(const Src& src, SkBitmap* dst, SkWStream*, SkString* log,
&props);
break;
case SkCommandLineConfigGpu::SurfType::kBackendTexture:
backendTexture = context->priv().createBackendTexture(
backendTexture = context->createBackendTexture(
info.width(), info.height(), info.colorType(), SkColors::kTransparent,
GrMipMapped::kNo, GrRenderable::kYes);
surface = SkSurface::MakeFromBackendTexture(context, backendTexture,

View File

@ -142,7 +142,7 @@ protected:
void createResultTexture(GrContext* context, int width, int height,
GrBackendTexture* resultTexture) {
*resultTexture = context->priv().createBackendTexture(
*resultTexture = context->createBackendTexture(
width, height, kRGBA_8888_SkColorType, SkColors::kTransparent,
GrMipMapped::kNo, GrRenderable::kYes);

View File

@ -346,8 +346,10 @@ public:
* before deleting the GrContext used to create them. Additionally, clients should only
* delete these objects on the thread for which that GrContext is active.
*
* Additionally, the client is responsible for ensuring synchronization between different uses
* of the backend object.
* The client is responsible for ensuring synchronization between different uses
* of the backend object (i.e., wrapping it in a surface, rendering to it, deleting the
* surface, rewrapping it in a image and drawing the image will require explicit
* sychronization on the client's part).
*/
// If possible, create an uninitialized backend texture. The client should ensure that the
@ -366,6 +368,20 @@ public:
GrMipMapped,
GrRenderable);
// If possible, create a backend texture initialized to a particular color. The client should
// ensure that the returned backend texture is valid.
GrBackendTexture createBackendTexture(int width, int height,
GrBackendFormat, const SkColor4f& color,
GrMipMapped, GrRenderable);
// If possible, create a backend texture initialized to a particular color. The client should
// ensure that the returned backend texture is valid.
// If successful, the created backend texture will be compatible with the provided
// SkColorType.
GrBackendTexture createBackendTexture(int width, int height,
SkColorType, const SkColor4f& color,
GrMipMapped, GrRenderable);
void deleteBackendTexture(GrBackendTexture);
protected:

View File

@ -392,6 +392,49 @@ GrBackendTexture GrContext::createBackendTexture(int width, int height,
return this->createBackendTexture(width, height, format, mipMapped, renderable);
}
GrBackendTexture GrContext::createBackendTexture(int width, int height,
GrBackendFormat backendFormat,
const SkColor4f& color,
GrMipMapped mipMapped,
GrRenderable renderable) {
if (!this->asDirectContext()) {
return GrBackendTexture();
}
if (this->abandoned()) {
return GrBackendTexture();
}
if (!backendFormat.isValid()) {
return GrBackendTexture();
}
return fGpu->createBackendTexture(width, height, backendFormat,
mipMapped, renderable,
nullptr, 0, color);
}
GrBackendTexture GrContext::createBackendTexture(int width, int height,
SkColorType colorType,
const SkColor4f& color,
GrMipMapped mipMapped,
GrRenderable renderable) {
if (!this->asDirectContext()) {
return GrBackendTexture();
}
if (this->abandoned()) {
return GrBackendTexture();
}
GrBackendFormat format = this->caps()->getBackendFormatFromColorType(colorType);
if (!format.isValid()) {
return GrBackendTexture();
}
return this->createBackendTexture(width, height, format, color, mipMapped, renderable);
}
void GrContext::deleteBackendTexture(GrBackendTexture backendTex) {
if (this->abandoned() || !backendTex.isValid()) {
return;

View File

@ -760,48 +760,3 @@ void GrContextPriv::testingOnly_flushAndRemoveOnFlushCallbackObject(GrOnFlushCal
fContext->drawingManager()->testingOnly_removeOnFlushCallbackObject(cb);
}
#endif
//////////////////////////////////////////////////////////////////////////////
GrBackendTexture GrContextPriv::createBackendTexture(int width, int height,
GrBackendFormat backendFormat,
const SkColor4f& color,
GrMipMapped mipMapped,
GrRenderable renderable) {
if (!fContext->asDirectContext()) {
return GrBackendTexture();
}
if (this->abandoned()) {
return GrBackendTexture();
}
if (!backendFormat.isValid()) {
return GrBackendTexture();
}
GrGpu* gpu = fContext->fGpu.get();
return gpu->createBackendTexture(width, height, backendFormat,
mipMapped, renderable, nullptr, 0, color);
}
GrBackendTexture GrContextPriv::createBackendTexture(int width, int height,
SkColorType colorType,
const SkColor4f& color,
GrMipMapped mipMapped,
GrRenderable renderable) {
if (!fContext->asDirectContext()) {
return GrBackendTexture();
}
if (this->abandoned()) {
return GrBackendTexture();
}
GrBackendFormat format = fContext->caps()->getBackendFormatFromColorType(colorType);
if (!format.isValid()) {
return GrBackendTexture();
}
return this->createBackendTexture(width, height, format, color, mipMapped, renderable);
}

View File

@ -292,20 +292,6 @@ public:
void testingOnly_flushAndRemoveOnFlushCallbackObject(GrOnFlushCallbackObject*);
#endif
// If possible, create a backend texture initialized to a particular color. The client should
// ensure that the returned backend texture is valid.
GrBackendTexture createBackendTexture(int width, int height,
GrBackendFormat, const SkColor4f& color,
GrMipMapped, GrRenderable);
// If possible, create a backend texture initialized to a particular color. The client should
// ensure that the returned backend texture is valid.
// If successful, the created backend texture will be compatible with the provided
// SkColorType.
GrBackendTexture createBackendTexture(int width, int height,
SkColorType, const SkColor4f& color,
GrMipMapped, GrRenderable);
private:
explicit GrContextPriv(GrContext* context) : fContext(context) {}
GrContextPriv(const GrContextPriv&); // unimpl

View File

@ -365,8 +365,8 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ColorTypeBackendAllocationTest, reporter, ctx
const SkColor4f& color,
GrMipMapped mipMapped,
GrRenderable renderable) {
return context->priv().createBackendTexture(32, 32, colorType, color,
mipMapped, renderable);
return context->createBackendTexture(32, 32, colorType, color,
mipMapped, renderable);
};
test_color_init(context, reporter, createWithColorMtd,
@ -527,8 +527,8 @@ DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(GLBackendAllocationTest, reporter, ctxInfo) {
const SkColor4f& color,
GrMipMapped mipMapped,
GrRenderable renderable) {
return context->priv().createBackendTexture(32, 32, format, color,
mipMapped, renderable);
return context->createBackendTexture(32, 32, format, color,
mipMapped, renderable);
};
test_color_init(context, reporter, createWithColorMtd,
@ -637,8 +637,8 @@ DEF_GPUTEST_FOR_VULKAN_CONTEXT(VkBackendAllocationTest, reporter, ctxInfo) {
const SkColor4f& color,
GrMipMapped mipMapped,
GrRenderable renderable) {
return context->priv().createBackendTexture(32, 32, format, color,
mipMapped, renderable);
return context->createBackendTexture(32, 32, format, color,
mipMapped, renderable);
};
test_color_init(context, reporter, createWithColorMtd,

View File

@ -185,9 +185,9 @@ public:
fColorType, fColorSpace, &fSurfaceProps);
}
*backend = context->priv().createBackendTexture(fWidth, fHeight, fColorType,
SkColors::kTransparent,
mipmapped, GrRenderable::kYes);
*backend = context->createBackendTexture(fWidth, fHeight, fColorType,
SkColors::kTransparent,
mipmapped, GrRenderable::kYes);
if (!backend->isValid() || !gpu->isTestingOnlyBackendTexture(*backend)) {
return nullptr;
}
@ -578,7 +578,7 @@ enum class DDLStage { kMakeImage, kDrawImage, kDetach, kDrawDDL };
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(DDLWrapBackendTest, reporter, ctxInfo) {
GrContext* context = ctxInfo.grContext();
GrBackendTexture backendTex = context->priv().createBackendTexture(
GrBackendTexture backendTex = context->createBackendTexture(
kSize, kSize, kRGBA_8888_SkColorType,
SkColors::kTransparent, GrMipMapped::kNo, GrRenderable::kNo);
if (!backendTex.isValid()) {

View File

@ -87,9 +87,9 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(EGLImageTest, reporter, ctxInfo) {
GrGpu* gpu1 = context1->priv().getGpu();
static const int kSize = 100;
backendTexture1 =
context1->priv().createBackendTexture(kSize, kSize, kRGBA_8888_SkColorType,
SkColors::kTransparent,
GrMipMapped::kNo, GrRenderable::kNo);
context1->createBackendTexture(kSize, kSize, kRGBA_8888_SkColorType,
SkColors::kTransparent,
GrMipMapped::kNo, GrRenderable::kNo);
if (!backendTexture1.isValid() || !gpu1->isTestingOnlyBackendTexture(backendTexture1)) {
ERRORF(reporter, "Error creating texture for EGL Image");

View File

@ -40,7 +40,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrWrappedMipMappedTest, reporter, ctxInfo) {
// createBackendTexture currently doesn't support uploading data to mip maps
// so we don't send any. However, we pretend there is data for the checks below which is
// fine since we are never actually using these textures for any work on the gpu.
GrBackendTexture backendTex = context->priv().createBackendTexture(
GrBackendTexture backendTex = context->createBackendTexture(
kSize, kSize, kRGBA_8888_SkColorType,
SkColors::kTransparent, mipMapped, renderable);
@ -106,7 +106,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrBackendTextureImageMipMappedTest, reporter,
for (auto mipMapped : {GrMipMapped::kNo, GrMipMapped::kYes}) {
for (auto willUseMips : {false, true}) {
GrBackendTexture backendTex = context->priv().createBackendTexture(
GrBackendTexture backendTex = context->createBackendTexture(
kSize, kSize, kRGBA_8888_SkColorType,
SkColors::kTransparent, mipMapped, GrRenderable::kNo);
@ -249,7 +249,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrImageSnapshotMipMappedTest, reporter, ctxIn
for (auto isWrapped : {false, true}) {
GrMipMapped mipMapped = willUseMips ? GrMipMapped::kYes : GrMipMapped::kNo;
sk_sp<SkSurface> surface;
GrBackendTexture backendTex = context->priv().createBackendTexture(
GrBackendTexture backendTex = context->createBackendTexture(
kSize, kSize, kRGBA_8888_SkColorType,
SkColors::kTransparent, mipMapped, GrRenderable::kYes);
if (isWrapped) {

View File

@ -997,8 +997,8 @@ DEF_GPUTEST(PorterDuffNoDualSourceBlending, reporter, options) {
}
GrBackendTexture backendTex =
ctx->priv().createBackendTexture(100, 100, kRGBA_8888_SkColorType, SkColors::kTransparent,
GrMipMapped::kNo, GrRenderable::kNo);
ctx->createBackendTexture(100, 100, kRGBA_8888_SkColorType, SkColors::kTransparent,
GrMipMapped::kNo, GrRenderable::kNo);
GrXferProcessor::DstProxy fakeDstProxy;
{

View File

@ -52,7 +52,7 @@ DEF_GPUTEST_FOR_MOCK_CONTEXT(GrSurface, reporter, ctxInfo) {
REPORTER_ASSERT(reporter, tex1.get() == tex1->asTexture());
REPORTER_ASSERT(reporter, static_cast<GrSurface*>(tex1.get()) == tex1->asTexture());
GrBackendTexture backendTex = context->priv().createBackendTexture(
GrBackendTexture backendTex = context->createBackendTexture(
256, 256, kRGBA_8888_SkColorType,
SkColors::kTransparent, GrMipMapped::kNo, GrRenderable::kNo);
@ -331,7 +331,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ReadOnlyTexture, reporter, context_info) {
// Mip regen should not work with a read only texture.
if (context->priv().caps()->mipMapSupport()) {
delete_backend_texture(context, backendTex);
backendTex = context->priv().createBackendTexture(
backendTex = context->createBackendTexture(
kSize, kSize, kRGBA_8888_SkColorType,
SkColors::kTransparent, GrMipMapped::kYes, GrRenderable::kYes);
proxy = proxyProvider->wrapBackendTexture(backendTex, kTopLeft_GrSurfaceOrigin,
@ -348,7 +348,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ReadOnlyTexture, reporter, context_info) {
}
static sk_sp<GrTexture> make_wrapped_texture(GrContext* context, GrRenderable renderable) {
auto backendTexture = context->priv().createBackendTexture(
auto backendTexture = context->createBackendTexture(
10, 10, kRGBA_8888_SkColorType, SkColors::kTransparent, GrMipMapped::kNo, renderable);
sk_sp<GrTexture> texture;
if (GrRenderable::kYes == renderable) {

View File

@ -490,7 +490,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrContext_colorTypeSupportedAsImage, reporter
SkColorType colorType = static_cast<SkColorType>(ct);
bool can = context->colorTypeSupportedAsImage(colorType);
GrBackendTexture backendTex = context->priv().createBackendTexture(
GrBackendTexture backendTex = context->createBackendTexture(
kSize, kSize, colorType, SkColors::kTransparent,
GrMipMapped::kNo, GrRenderable::kNo);

View File

@ -471,7 +471,7 @@ DEF_GPUTEST(LazyProxyDeinstantiateTest, reporter, /* options */) {
desc.fHeight = kSize;
desc.fConfig = kRGBA_8888_GrPixelConfig;
GrBackendTexture backendTex = ctx->priv().createBackendTexture(
GrBackendTexture backendTex = ctx->createBackendTexture(
kSize, kSize, kRGBA_8888_SkColorType, SkColors::kTransparent,
GrMipMapped::kNo, GrRenderable::kNo);

View File

@ -167,7 +167,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(PromiseImageTest, reporter, ctxInfo) {
GrContext* ctx = ctxInfo.grContext();
GrGpu* gpu = ctx->priv().getGpu();
GrBackendTexture backendTex = ctx->priv().createBackendTexture(
GrBackendTexture backendTex = ctx->createBackendTexture(
kWidth, kHeight, kRGBA_8888_SkColorType,
SkColors::kTransparent, GrMipMapped::kNo, GrRenderable::kYes);
REPORTER_ASSERT(reporter, backendTex.isValid());
@ -243,12 +243,12 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(PromiseImageTextureReuseDifferentConfig, repo
GrContext* ctx = ctxInfo.grContext();
GrGpu* gpu = ctx->priv().getGpu();
GrBackendTexture backendTex1 = ctx->priv().createBackendTexture(
GrBackendTexture backendTex1 = ctx->createBackendTexture(
kWidth, kHeight, kGray_8_SkColorType,
SkColors::kTransparent, GrMipMapped::kNo, GrRenderable::kNo);
REPORTER_ASSERT(reporter, backendTex1.isValid());
GrBackendTexture backendTex2 = ctx->priv().createBackendTexture(
GrBackendTexture backendTex2 = ctx->createBackendTexture(
kWidth, kHeight, kAlpha_8_SkColorType,
SkColors::kTransparent, GrMipMapped::kNo, GrRenderable::kNo);
REPORTER_ASSERT(reporter, backendTex2.isValid());
@ -355,7 +355,7 @@ DEF_GPUTEST(PromiseImageTextureShutdown, reporter, ctxInfo) {
continue;
}
GrBackendTexture backendTex = ctx->priv().createBackendTexture(
GrBackendTexture backendTex = ctx->createBackendTexture(
kWidth, kHeight, kAlpha_8_SkColorType,
SkColors::kTransparent, GrMipMapped::kNo, GrRenderable::kNo);
REPORTER_ASSERT(reporter, backendTex.isValid());
@ -394,7 +394,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(PromiseImageTextureFullCache, reporter, ctxIn
GrContext* ctx = ctxInfo.grContext();
GrBackendTexture backendTex = ctx->priv().createBackendTexture(
GrBackendTexture backendTex = ctx->createBackendTexture(
kWidth, kHeight, kAlpha_8_SkColorType,
SkColors::kTransparent, GrMipMapped::kNo, GrRenderable::kNo);
REPORTER_ASSERT(reporter, backendTex.isValid());
@ -458,7 +458,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(PromiseImageNullFulfill, reporter, ctxInfo) {
GrContext* ctx = ctxInfo.grContext();
// Do all this just to get a valid backend format for the image.
GrBackendTexture backendTex = ctx->priv().createBackendTexture(
GrBackendTexture backendTex = ctx->createBackendTexture(
kWidth, kHeight, kRGBA_8888_SkColorType,
SkColors::kTransparent, GrMipMapped::kNo, GrRenderable::kYes);
REPORTER_ASSERT(reporter, backendTex.isValid());

View File

@ -275,11 +275,11 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WrappedProxyTest, reporter, ctxInfo) {
// Tests wrapBackendRenderTarget with a GrBackendTexture
{
GrBackendTexture backendTex =
context->priv().createBackendTexture(kWidthHeight, kWidthHeight,
colorType,
SkColors::kTransparent,
GrMipMapped::kNo,
GrRenderable::kYes);
context->createBackendTexture(kWidthHeight, kWidthHeight,
colorType,
SkColors::kTransparent,
GrMipMapped::kNo,
GrRenderable::kYes);
sk_sp<GrSurfaceProxy> sProxy = proxyProvider->wrapBackendTextureAsRenderTarget(
backendTex, origin, supportedNumSamples);
if (!sProxy) {
@ -301,11 +301,11 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WrappedProxyTest, reporter, ctxInfo) {
// Tests wrapBackendTexture that is only renderable
{
GrBackendTexture backendTex =
context->priv().createBackendTexture(kWidthHeight, kWidthHeight,
colorType,
SkColors::kTransparent,
GrMipMapped::kNo,
GrRenderable::kYes);
context->createBackendTexture(kWidthHeight, kWidthHeight,
colorType,
SkColors::kTransparent,
GrMipMapped::kNo,
GrRenderable::kYes);
sk_sp<GrSurfaceProxy> sProxy = proxyProvider->wrapRenderableBackendTexture(
backendTex, origin, supportedNumSamples, kBorrow_GrWrapOwnership,
@ -330,11 +330,11 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WrappedProxyTest, reporter, ctxInfo) {
{
// Internal offscreen texture
GrBackendTexture backendTex =
context->priv().createBackendTexture(kWidthHeight, kWidthHeight,
colorType,
SkColors::kTransparent,
GrMipMapped::kNo,
GrRenderable::kNo);
context->createBackendTexture(kWidthHeight, kWidthHeight,
colorType,
SkColors::kTransparent,
GrMipMapped::kNo,
GrRenderable::kNo);
sk_sp<GrSurfaceProxy> sProxy = proxyProvider->wrapBackendTexture(
backendTex, origin, kBorrow_GrWrapOwnership, GrWrapCacheable::kNo,

View File

@ -62,9 +62,9 @@ static GrSurfaceProxy* make_backend(GrContext* context, const ProxyParams& p,
GrBackendTexture* backendTex) {
GrProxyProvider* proxyProvider = context->priv().proxyProvider();
*backendTex = context->priv().createBackendTexture(p.fSize, p.fSize, p.fColorType,
SkColors::kTransparent,
GrMipMapped::kNo, GrRenderable::kNo);
*backendTex = context->createBackendTexture(p.fSize, p.fSize, p.fColorType,
SkColors::kTransparent,
GrMipMapped::kNo, GrRenderable::kNo);
if (!backendTex->isValid()) {
return nullptr;
}

View File

@ -209,12 +209,12 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ResourceCacheWrappedResources, reporter, ctxI
static const int kW = 100;
static const int kH = 100;
backendTextures[0] = context->priv().createBackendTexture(kW, kH, kRGBA_8888_SkColorType,
SkColors::kTransparent,
GrMipMapped::kNo, GrRenderable::kNo);
backendTextures[1] = context->priv().createBackendTexture(kW, kH, kRGBA_8888_SkColorType,
SkColors::kTransparent,
GrMipMapped::kNo, GrRenderable::kNo);
backendTextures[0] = context->createBackendTexture(kW, kH, kRGBA_8888_SkColorType,
SkColors::kTransparent,
GrMipMapped::kNo, GrRenderable::kNo);
backendTextures[1] = context->createBackendTexture(kW, kH, kRGBA_8888_SkColorType,
SkColors::kTransparent,
GrMipMapped::kNo, GrRenderable::kNo);
REPORTER_ASSERT(reporter, backendTextures[0].isValid());
REPORTER_ASSERT(reporter, backendTextures[1].isValid());
if (!backendTextures[0].isValid() || !backendTextures[1].isValid()) {

View File

@ -102,7 +102,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrContext_colorTypeSupportedAsSurface, report
REPORTER_ASSERT(reporter, can == SkToBool(surf), "ct: %d, can: %d, surf: %d",
colorType, can, SkToBool(surf));
GrBackendTexture backendTex = context->priv().createBackendTexture(
GrBackendTexture backendTex = context->createBackendTexture(
kSize, kSize, colorType,
SkColors::kTransparent, GrMipMapped::kNo, GrRenderable::kYes);
surf = SkSurface::MakeFromBackendTexture(context, backendTex,
@ -128,9 +128,9 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrContext_colorTypeSupportedAsSurface, report
REPORTER_ASSERT(reporter, can == SkToBool(surf), "ct: %d, can: %d, surf: %d",
colorType, can, SkToBool(surf));
backendTex = context->priv().createBackendTexture(kSize, kSize, colorType,
SkColors::kTransparent,
GrMipMapped::kNo, GrRenderable::kYes);
backendTex = context->createBackendTexture(kSize, kSize, colorType,
SkColors::kTransparent,
GrMipMapped::kNo, GrRenderable::kYes);
surf = SkSurface::MakeFromBackendTexture(context, backendTex,
kTopLeft_GrSurfaceOrigin, kSampleCnt, colorType,
nullptr, nullptr);
@ -198,7 +198,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrContext_maxSurfaceSamplesForColorType, repo
if (!max) {
continue;
}
GrBackendTexture backendTex = context->priv().createBackendTexture(
GrBackendTexture backendTex = context->createBackendTexture(
kSize, kSize, colorType, SkColors::kTransparent,
GrMipMapped::kNo, GrRenderable::kYes);
if (!backendTex.isValid()) {

View File

@ -101,7 +101,7 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(TextureBindingsResetTest, reporter, ctxInf
context->resetContext();
if (supportExternal) {
GrBackendTexture texture2D = context->priv().createBackendTexture(
GrBackendTexture texture2D = context->createBackendTexture(
10, 10, kRGBA_8888_SkColorType,
SkColors::kTransparent, GrMipMapped::kNo, GrRenderable::kNo);
GrGLTextureInfo info2D;

View File

@ -32,11 +32,11 @@
DEF_GPUTEST_FOR_VULKAN_CONTEXT(VkImageLayoutTest, reporter, ctxInfo) {
GrContext* context = ctxInfo.grContext();
GrBackendTexture backendTex = context->priv().createBackendTexture(1, 1,
kRGBA_8888_SkColorType,
SkColors::kTransparent,
GrMipMapped::kNo,
GrRenderable::kNo);
GrBackendTexture backendTex = context->createBackendTexture(1, 1,
kRGBA_8888_SkColorType,
SkColors::kTransparent,
GrMipMapped::kNo,
GrRenderable::kNo);
REPORTER_ASSERT(reporter, backendTex.isValid());
GrVkImageInfo info;
@ -139,11 +139,11 @@ DEF_GPUTEST_FOR_VULKAN_CONTEXT(VkReleaseExternalQueueTest, reporter, ctxInfo) {
}
for (bool useExternal : {false, true}) {
GrBackendTexture backendTex = context->priv().createBackendTexture(1, 1,
kRGBA_8888_SkColorType,
SkColors::kTransparent,
GrMipMapped::kNo,
GrRenderable::kNo);
GrBackendTexture backendTex = context->createBackendTexture(1, 1,
kRGBA_8888_SkColorType,
SkColors::kTransparent,
GrMipMapped::kNo,
GrRenderable::kNo);
sk_sp<SkImage> image;
int count = 0;
if (useExternal) {
@ -224,7 +224,7 @@ DEF_GPUTEST_FOR_VULKAN_CONTEXT(VkPrepareForExternalIOQueueTransitionTest, report
// We don't set textures to present
continue;
}
GrBackendTexture backendTex = context->priv().createBackendTexture(
GrBackendTexture backendTex = context->createBackendTexture(
4, 4, kRGBA_8888_SkColorType,
SkColors::kTransparent, GrMipMapped::kNo,
useSurface ? GrRenderable::kYes : GrRenderable::kNo);
@ -341,7 +341,7 @@ DEF_GPUTEST_FOR_VULKAN_CONTEXT(VkTransitionExternalQueueTest, reporter, ctxInfo)
return;
}
GrBackendTexture backendTex = context->priv().createBackendTexture(
GrBackendTexture backendTex = context->createBackendTexture(
1, 1, kRGBA_8888_SkColorType,
SkColors::kTransparent, GrMipMapped::kNo, GrRenderable::kNo);
sk_sp<SkImage> image;

View File

@ -36,11 +36,11 @@ void wrap_tex_test(skiatest::Reporter* reporter, GrContext* context) {
GrGpu* gpu = context->priv().getGpu();
GrBackendTexture origBackendTex = context->priv().createBackendTexture(kW, kH,
kColorType,
SkColors::kTransparent,
GrMipMapped::kNo,
GrRenderable::kNo);
GrBackendTexture origBackendTex = context->createBackendTexture(kW, kH,
kColorType,
SkColors::kTransparent,
GrMipMapped::kNo,
GrRenderable::kNo);
GrVkImageInfo imageInfo;
SkAssertResult(origBackendTex.getVkImageInfo(&imageInfo));
@ -91,11 +91,11 @@ void wrap_tex_test(skiatest::Reporter* reporter, GrContext* context) {
void wrap_rt_test(skiatest::Reporter* reporter, GrContext* context) {
GrGpu* gpu = context->priv().getGpu();
GrBackendTexture origBackendTex = context->priv().createBackendTexture(kW, kH,
kColorType,
SkColors::kTransparent,
GrMipMapped::kNo,
GrRenderable::kYes);
GrBackendTexture origBackendTex = context->createBackendTexture(kW, kH,
kColorType,
SkColors::kTransparent,
GrMipMapped::kNo,
GrRenderable::kYes);
GrVkImageInfo imageInfo;
SkAssertResult(origBackendTex.getVkImageInfo(&imageInfo));
@ -135,11 +135,11 @@ void wrap_rt_test(skiatest::Reporter* reporter, GrContext* context) {
void wrap_trt_test(skiatest::Reporter* reporter, GrContext* context) {
GrGpu* gpu = context->priv().getGpu();
GrBackendTexture origBackendTex = context->priv().createBackendTexture(kW, kH,
kColorType,
SkColors::kTransparent,
GrMipMapped::kNo,
GrRenderable::kYes);
GrBackendTexture origBackendTex = context->createBackendTexture(kW, kH,
kColorType,
SkColors::kTransparent,
GrMipMapped::kNo,
GrRenderable::kYes);
GrVkImageInfo imageInfo;
SkAssertResult(origBackendTex.getVkImageInfo(&imageInfo));

View File

@ -455,7 +455,7 @@ static void test_write_pixels_non_texture(skiatest::Reporter* reporter,
int sampleCnt) {
for (auto& origin : { kTopLeft_GrSurfaceOrigin, kBottomLeft_GrSurfaceOrigin }) {
GrBackendTexture backendTex = context->priv().createBackendTexture(
GrBackendTexture backendTex = context->createBackendTexture(
DEV_W, DEV_H, kRGBA_8888_SkColorType,
SkColors::kTransparent, GrMipMapped::kNo, GrRenderable::kYes);
if (!backendTex.isValid()) {

View File

@ -34,7 +34,7 @@ sk_sp<GrTextureProxy> MakeTextureProxyFromData(GrContext* context, GrRenderable
sk_sp<GrTextureProxy> proxy;
if (kBottomLeft_GrSurfaceOrigin == origin) {
// We (soon will) only support using kBottomLeft with wrapped textures.
auto backendTex = context->priv().createBackendTexture(
auto backendTex = context->createBackendTexture(
width, height, format, SkColors::kTransparent, GrMipMapped::kNo, renderable);
if (!backendTex.isValid()) {
return nullptr;