diff options
author | Brian Salomon <bsalomon@google.com> | 2018-03-03 22:43:43 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-03-05 18:50:25 +0000 |
commit | 2a4f983c94e4f749fe24b08bc8b5ae7cc8550d1d (patch) | |
tree | e89d794eeffacf09124be0cee8bfc70001be2856 /src/gpu/GrSurfaceProxy.cpp | |
parent | 1a8d762a18d6f6494408a3a5e06a80097f8b85f7 (diff) |
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>
Diffstat (limited to 'src/gpu/GrSurfaceProxy.cpp')
-rw-r--r-- | src/gpu/GrSurfaceProxy.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/gpu/GrSurfaceProxy.cpp b/src/gpu/GrSurfaceProxy.cpp index 7acc03b05a..b8132e8a89 100644 --- a/src/gpu/GrSurfaceProxy.cpp +++ b/src/gpu/GrSurfaceProxy.cpp @@ -45,12 +45,12 @@ static bool is_valid_non_lazy(const GrSurfaceDesc& desc) { // Lazy-callback version GrSurfaceProxy::GrSurfaceProxy(LazyInstantiateCallback&& callback, LazyInstantiationType lazyType, - const GrSurfaceDesc& desc, SkBackingFit fit, SkBudgeted budgeted, - uint32_t flags) + const GrSurfaceDesc& desc, GrSurfaceOrigin origin, SkBackingFit fit, + SkBudgeted budgeted, uint32_t flags) : fConfig(desc.fConfig) , fWidth(desc.fWidth) , fHeight(desc.fHeight) - , fOrigin(desc.fOrigin) + , fOrigin(origin) , fFit(fit) , fBudgeted(budgeted) , fFlags(flags) @@ -122,7 +122,6 @@ sk_sp<GrSurface> GrSurfaceProxy::createSurfaceImpl( if (fNeedsClear) { desc.fFlags |= kPerformInitialClear_GrSurfaceFlag; } - desc.fOrigin = fOrigin; desc.fWidth = fWidth; desc.fHeight = fHeight; desc.fConfig = fConfig; @@ -145,7 +144,7 @@ sk_sp<GrSurface> GrSurfaceProxy::createSurfaceImpl( texels[i].fRowBytes = 0; } - surface = resourceProvider->createTexture(desc, fBudgeted, texels.get(), mipCount, + surface = resourceProvider->createTexture(desc, fBudgeted, fOrigin, texels.get(), mipCount, SkDestinationSurfaceColorMode::kLegacy); if (surface) { SkASSERT(surface->asTexture()); @@ -300,7 +299,6 @@ sk_sp<GrTextureProxy> GrSurfaceProxy::Copy(GrContext* context, } GrSurfaceDesc dstDesc; - dstDesc.fOrigin = src->origin(); dstDesc.fWidth = srcRect.width(); dstDesc.fHeight = srcRect.height(); dstDesc.fConfig = src->config(); @@ -315,7 +313,8 @@ sk_sp<GrTextureProxy> GrSurfaceProxy::Copy(GrContext* context, colorSpace = SkColorSpace::MakeSRGB(); } sk_sp<GrSurfaceContext> dstContext(context->contextPriv().makeDeferredSurfaceContext( - dstDesc, mipMapped, SkBackingFit::kExact, budgeted, std::move(colorSpace))); + dstDesc, src->origin(), mipMapped, SkBackingFit::kExact, budgeted, + std::move(colorSpace))); if (!dstContext) { return nullptr; } @@ -334,13 +333,10 @@ sk_sp<GrTextureProxy> GrSurfaceProxy::Copy(GrContext* context, GrSurfaceProxy* s } sk_sp<GrSurfaceContext> GrSurfaceProxy::TestCopy(GrContext* context, const GrSurfaceDesc& dstDesc, - GrSurfaceProxy* srcProxy) { + GrSurfaceOrigin origin, GrSurfaceProxy* srcProxy) { SkASSERT(LazyState::kFully != srcProxy->lazyInstantiationState()); sk_sp<GrSurfaceContext> dstContext(context->contextPriv().makeDeferredSurfaceContext( - dstDesc, - GrMipMapped::kNo, - SkBackingFit::kExact, - SkBudgeted::kYes)); + dstDesc, origin, GrMipMapped::kNo, SkBackingFit::kExact, SkBudgeted::kYes)); if (!dstContext) { return nullptr; } |