Remove origin field from GrSurface (take 2)
This mainly consists of rm origin from GrSurface and the wrapBackEnd*
methods and then re-adding an explicit origin parameter to all the
GrGpu methods that need it.
TBR=bsalomon@google.com
Change-Id: I4248b2a4749ef844da4233ce53b0dc504bc9eb74
Reviewed-on: https://skia-review.googlesource.com/30280
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/vk/GrVkCopyManager.cpp b/src/gpu/vk/GrVkCopyManager.cpp
index 040d742..9e1decf 100644
--- a/src/gpu/vk/GrVkCopyManager.cpp
+++ b/src/gpu/vk/GrVkCopyManager.cpp
@@ -143,10 +143,9 @@
}
bool GrVkCopyManager::copySurfaceAsDraw(GrVkGpu* gpu,
- GrSurface* dst,
- GrSurface* src,
- const SkIRect& srcRect,
- const SkIPoint& dstPoint) {
+ GrSurface* dst, GrSurfaceOrigin dstOrigin,
+ GrSurface* src, GrSurfaceOrigin srcOrigin,
+ const SkIRect& srcRect, const SkIPoint& dstPoint) {
// None of our copy methods can handle a swizzle. TODO: Make copySurfaceAsDraw handle the
// swizzle.
if (gpu->caps()->shaderCaps()->configOutputSwizzle(src->config()) !=
@@ -204,7 +203,7 @@
float dx1 = 2.f * (dstPoint.fX + w) / dw - 1.f;
float dy0 = 2.f * dstPoint.fY / dh - 1.f;
float dy1 = 2.f * (dstPoint.fY + h) / dh - 1.f;
- if (kBottomLeft_GrSurfaceOrigin == dst->origin()) {
+ if (kBottomLeft_GrSurfaceOrigin == dstOrigin) {
dy0 = -dy0;
dy1 = -dy1;
}
@@ -215,7 +214,7 @@
float sy0 = (float)srcRect.fTop;
float sy1 = (float)(srcRect.fTop + h);
int sh = src->height();
- if (kBottomLeft_GrSurfaceOrigin == src->origin()) {
+ if (kBottomLeft_GrSurfaceOrigin == srcOrigin) {
sy0 = sh - sy0;
sy1 = sh - sy1;
}
@@ -293,7 +292,7 @@
GrVkRenderTarget* texRT = static_cast<GrVkRenderTarget*>(srcTex->asRenderTarget());
if (texRT) {
- gpu->onResolveRenderTarget(texRT);
+ gpu->onResolveRenderTarget(texRT, srcOrigin);
}
GrVkPrimaryCommandBuffer* cmdBuffer = gpu->currentCommandBuffer();