diff options
author | 2018-03-03 22:43:43 -0500 | |
---|---|---|
committer | 2018-03-05 18:50:25 +0000 | |
commit | 2a4f983c94e4f749fe24b08bc8b5ae7cc8550d1d (patch) | |
tree | e89d794eeffacf09124be0cee8bfc70001be2856 /gm/flippity.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 'gm/flippity.cpp')
-rw-r--r-- | gm/flippity.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/gm/flippity.cpp b/gm/flippity.cpp index bd9930c9df..554b4d151b 100644 --- a/gm/flippity.cpp +++ b/gm/flippity.cpp @@ -111,15 +111,11 @@ static sk_sp<SkImage> make_reference_image(GrContext* context, } GrSurfaceDesc desc; - desc.fOrigin = kTopLeft_GrSurfaceOrigin; desc.fWidth = kImageSize; desc.fHeight = kImageSize; desc.fConfig = kRGBA_8888_GrPixelConfig; - if (bottomLeftOrigin) { - // Note that Ganesh will flip the data when it is uploaded - desc.fOrigin = kBottomLeft_GrSurfaceOrigin; - } + auto origin = bottomLeftOrigin ? kBottomLeft_GrSurfaceOrigin : kTopLeft_GrSurfaceOrigin; if (kN32_SkColorType == kBGRA_8888_SkColorType) { // We're playing a game here and uploading N32 data into an RGB dest. We might have @@ -132,7 +128,7 @@ static sk_sp<SkImage> make_reference_image(GrContext* context, } } - sk_sp<GrTextureProxy> proxy = proxyProvider->createTextureProxy(desc, SkBudgeted::kYes, + sk_sp<GrTextureProxy> proxy = proxyProvider->createTextureProxy(desc, origin, SkBudgeted::kYes, bm.getPixels(), bm.rowBytes()); if (!proxy) { return nullptr; |