From 2a4f983c94e4f749fe24b08bc8b5ae7cc8550d1d Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Sat, 3 Mar 2018 22:43:43 -0500 Subject: Remove GrSurfaceOrigin from GrSurfaceDesc. This field has no interpretation at the GrTexture/GrGpu as the orientation is handled at the GrSurfaceProxy level. This change requires GrGpu to accept a GrSurfaceOrigin when creating a texture with initial data. The origin refers to the texel data to be uploaded. Longer term the plan is to remove this and require the data to be kTopLeft. Additionally, kBottomLeft will only be allowed for wrapped texture/RTs as this evolves. Change-Id: I7d25b0199aafd9bf3b74c39b2cae451acadcd772 Reviewed-on: https://skia-review.googlesource.com/111806 Reviewed-by: Robert Phillips Commit-Queue: Brian Salomon --- tests/GrSurfaceTest.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'tests/GrSurfaceTest.cpp') diff --git a/tests/GrSurfaceTest.cpp b/tests/GrSurfaceTest.cpp index a645f99c3e..daef511bb6 100644 --- a/tests/GrSurfaceTest.cpp +++ b/tests/GrSurfaceTest.cpp @@ -29,7 +29,6 @@ DEF_GPUTEST_FOR_NULLGL_CONTEXT(GrSurface, reporter, ctxInfo) { GrSurfaceDesc desc; desc.fFlags = kRenderTarget_GrSurfaceFlag; - desc.fOrigin = kBottomLeft_GrSurfaceOrigin; desc.fWidth = 256; desc.fHeight = 256; desc.fConfig = kRGBA_8888_GrPixelConfig; @@ -46,7 +45,6 @@ DEF_GPUTEST_FOR_NULLGL_CONTEXT(GrSurface, reporter, ctxInfo) { static_cast(texRT1->asTexture())); desc.fFlags = kNone_GrSurfaceFlags; - desc.fOrigin = kTopLeft_GrSurfaceOrigin; sk_sp tex1 = resourceProvider->createTexture(desc, SkBudgeted::kNo); REPORTER_ASSERT(reporter, nullptr == tex1->asRenderTarget()); REPORTER_ASSERT(reporter, tex1.get() == tex1->asTexture()); @@ -108,7 +106,6 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(GrSurfaceRenderability, reporter, ctxInfo) { for (GrPixelConfig config : configs) { for (GrSurfaceOrigin origin : { kTopLeft_GrSurfaceOrigin, kBottomLeft_GrSurfaceOrigin }) { desc.fFlags = kNone_GrSurfaceFlags; - desc.fOrigin = origin; desc.fConfig = config; desc.fSampleCnt = 1; @@ -117,8 +114,8 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(GrSurfaceRenderability, reporter, ctxInfo) { REPORTER_ASSERT(reporter, SkToBool(tex) == ict, "config:%d, tex:%d, isConfigTexturable:%d", config, SkToBool(tex), ict); - sk_sp proxy = proxyProvider->createMipMapProxy( - desc, SkBudgeted::kNo); + sk_sp proxy = + proxyProvider->createMipMapProxy(desc, origin, SkBudgeted::kNo); REPORTER_ASSERT(reporter, SkToBool(proxy.get()) == (caps->isConfigTexturable(desc.fConfig) && caps->mipMapSupport())); @@ -170,13 +167,12 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(InitialTextureClear, reporter, context_info) desc.fFlags |= rt ? kRenderTarget_GrSurfaceFlag : kNone_GrSurfaceFlags; for (GrSurfaceOrigin origin : {kTopLeft_GrSurfaceOrigin, kBottomLeft_GrSurfaceOrigin}) { - desc.fOrigin = origin; for (auto fit : { SkBackingFit::kApprox, SkBackingFit::kExact }) { // Try directly creating the texture. // Do this twice in an attempt to hit the cache on the second time through. for (int i = 0; i < 2; ++i) { sk_sp proxy = proxyProvider->createInstantiatedProxy( - desc, fit, SkBudgeted::kYes); + desc, origin, fit, SkBudgeted::kYes); if (!proxy) { continue; } @@ -206,7 +202,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(InitialTextureClear, reporter, context_info) // Try creating the texture as a deferred proxy. for (int i = 0; i < 2; ++i) { auto surfCtx = context->contextPriv().makeDeferredSurfaceContext( - desc, GrMipMapped::kNo, fit, SkBudgeted::kYes, colorSpace); + desc, origin, GrMipMapped::kNo, fit, SkBudgeted::kYes, colorSpace); if (!surfCtx) { continue; } -- cgit v1.2.3