Fix RTAdjust for Direct3D.

D3D's NDC space is y-flipped compared to Vulkan and Metal.

Change-Id: I9ab55efd431f2db877cea8e55d78eec737655a38
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293341
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This commit is contained in:
Jim Van Verth 2020-06-01 15:30:47 -04:00 committed by Skia Commit-Bot
parent 43182bccce
commit f5776b7f19

View File

@ -88,7 +88,8 @@ private:
void getRTAdjustmentVec(float* destVec) {
destVec[0] = 2.f / fRenderTargetSize.fWidth;
destVec[1] = -1.f;
if (kBottomLeft_GrSurfaceOrigin == fRenderTargetOrigin) {
// D3D's NDC space is flipped from Vulkan and Metal
if (kTopLeft_GrSurfaceOrigin == fRenderTargetOrigin) {
destVec[2] = -2.f / fRenderTargetSize.fHeight;
destVec[3] = 1.f;
} else {