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 <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/tests/GrSurfaceTest.cpp b/tests/GrSurfaceTest.cpp
index a645f99..daef511 100644
--- a/tests/GrSurfaceTest.cpp
+++ b/tests/GrSurfaceTest.cpp
@@ -29,7 +29,6 @@
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 @@
static_cast<GrSurface*>(texRT1->asTexture()));
desc.fFlags = kNone_GrSurfaceFlags;
- desc.fOrigin = kTopLeft_GrSurfaceOrigin;
sk_sp<GrTexture> tex1 = resourceProvider->createTexture(desc, SkBudgeted::kNo);
REPORTER_ASSERT(reporter, nullptr == tex1->asRenderTarget());
REPORTER_ASSERT(reporter, tex1.get() == tex1->asTexture());
@@ -108,7 +106,6 @@
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 @@
REPORTER_ASSERT(reporter, SkToBool(tex) == ict,
"config:%d, tex:%d, isConfigTexturable:%d", config, SkToBool(tex), ict);
- sk_sp<GrTextureProxy> proxy = proxyProvider->createMipMapProxy(
- desc, SkBudgeted::kNo);
+ sk_sp<GrTextureProxy> proxy =
+ proxyProvider->createMipMapProxy(desc, origin, SkBudgeted::kNo);
REPORTER_ASSERT(reporter, SkToBool(proxy.get()) ==
(caps->isConfigTexturable(desc.fConfig) &&
caps->mipMapSupport()));
@@ -170,13 +167,12 @@
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<GrTextureProxy> proxy = proxyProvider->createInstantiatedProxy(
- desc, fit, SkBudgeted::kYes);
+ desc, origin, fit, SkBudgeted::kYes);
if (!proxy) {
continue;
}
@@ -206,7 +202,7 @@
// 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;
}