diff options
author | 2018-03-03 22:43:43 -0500 | |
---|---|---|
committer | 2018-03-05 18:50:25 +0000 | |
commit | 2a4f983c94e4f749fe24b08bc8b5ae7cc8550d1d (patch) | |
tree | e89d794eeffacf09124be0cee8bfc70001be2856 /src/gpu/GrResourceProvider.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/GrResourceProvider.cpp')
-rw-r--r-- | src/gpu/GrResourceProvider.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gpu/GrResourceProvider.cpp b/src/gpu/GrResourceProvider.cpp index df09e27d7e..62a17a4a16 100644 --- a/src/gpu/GrResourceProvider.cpp +++ b/src/gpu/GrResourceProvider.cpp @@ -62,6 +62,7 @@ GrResourceProvider::GrResourceProvider(GrGpu* gpu, GrResourceCache* cache, GrSin } sk_sp<GrTexture> GrResourceProvider::createTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted, + GrSurfaceOrigin texelsOrigin, const GrMipLevel texels[], int mipLevelCount, SkDestinationSurfaceColorMode mipColorMode) { ASSERT_SINGLE_OWNER @@ -77,7 +78,7 @@ sk_sp<GrTexture> GrResourceProvider::createTexture(const GrSurfaceDesc& desc, Sk return nullptr; } - sk_sp<GrTexture> tex(fGpu->createTexture(desc, budgeted, texels, mipLevelCount)); + sk_sp<GrTexture> tex(fGpu->createTexture(desc, budgeted, texelsOrigin, texels, mipLevelCount)); if (tex) { tex->texturePriv().setMipColorMode(mipColorMode); } @@ -108,6 +109,7 @@ static bool make_info(int w, int h, GrPixelConfig config, SkImageInfo* ii) { sk_sp<GrTexture> GrResourceProvider::createTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted, SkBackingFit fit, + GrSurfaceOrigin mipLevelOrigin, const GrMipLevel& mipLevel) { ASSERT_SINGLE_OWNER @@ -131,9 +133,8 @@ sk_sp<GrTexture> GrResourceProvider::createTexture(const GrSurfaceDesc& desc, if (make_info(desc.fWidth, desc.fHeight, desc.fConfig, &srcInfo)) { // DDL TODO: remove this use of createInstantiatedProxy and convert it to a testing-only // method. - sk_sp<GrTextureProxy> proxy = proxyProvider->createInstantiatedProxy(desc, - fit, - budgeted); + sk_sp<GrTextureProxy> proxy = + proxyProvider->createInstantiatedProxy(desc, mipLevelOrigin, fit, budgeted); if (proxy) { // We use an ephemeral surface context to do the write pixels. Here it isn't clear what // color space to tag it with. That's ok because GrSurfaceContext::writePixels doesn't @@ -154,7 +155,7 @@ sk_sp<GrTexture> GrResourceProvider::createTexture(const GrSurfaceDesc& desc, } } - return fGpu->createTexture(desc, budgeted, &mipLevel, 1); + return fGpu->createTexture(desc, budgeted, mipLevelOrigin, &mipLevel, 1); } sk_sp<GrTexture> GrResourceProvider::createTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted, |