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 /tools/fiddle | |
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 'tools/fiddle')
-rw-r--r-- | tools/fiddle/fiddle_main.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/tools/fiddle/fiddle_main.cpp b/tools/fiddle/fiddle_main.cpp index 9ade250b0a..891b1ffecc 100644 --- a/tools/fiddle/fiddle_main.cpp +++ b/tools/fiddle/fiddle_main.cpp @@ -128,7 +128,6 @@ static bool setup_backend_objects(GrContext* context, GrSurfaceDesc backingDesc; backingDesc.fFlags = kNone_GrSurfaceFlags; - backingDesc.fOrigin = kTopLeft_GrSurfaceOrigin; backingDesc.fWidth = bm.width(); backingDesc.fHeight = bm.height(); // This config must match the SkColorType used in draw.cpp in the SkImage and Surface factories @@ -165,9 +164,9 @@ static bool setup_backend_objects(GrContext* context, texels[i].fRowBytes = 0; } - backingTexture = resourceProvider->createTexture(backingDesc, SkBudgeted::kNo, - texels.get(), mipLevelCount, - SkDestinationSurfaceColorMode::kLegacy); + backingTexture = resourceProvider->createTexture( + backingDesc, SkBudgeted::kNo, kTopLeft_GrSurfaceOrigin, texels.get(), mipLevelCount, + SkDestinationSurfaceColorMode::kLegacy); if (!backingTexture) { return false; } @@ -194,9 +193,8 @@ static bool setup_backend_objects(GrContext* context, GrMipLevel level0 = { data.get(), backingDesc.fWidth*sizeof(uint32_t) }; sk_sp<GrTexture> tmp = resourceProvider->createTexture( - backingDesc, SkBudgeted::kNo, - &level0, 1, - SkDestinationSurfaceColorMode::kLegacy); + backingDesc, SkBudgeted::kNo, kTopLeft_GrSurfaceOrigin, &level0, 1, + SkDestinationSurfaceColorMode::kLegacy); if (!tmp || !tmp->asRenderTarget()) { return false; } @@ -224,9 +222,8 @@ static bool setup_backend_objects(GrContext* context, } backingTextureRenderTarget = resourceProvider->createTexture( - backingDesc, SkBudgeted::kNo, - texels.get(), mipLevelCount, - SkDestinationSurfaceColorMode::kLegacy); + backingDesc, SkBudgeted::kNo, kTopLeft_GrSurfaceOrigin, texels.get(), mipLevelCount, + SkDestinationSurfaceColorMode::kLegacy); if (!backingTextureRenderTarget || !backingTextureRenderTarget->asRenderTarget()) { return false; } |