Revert "Remove origin field from GrSurface"
This reverts commit df0e09feacb29290fe94d37f921731b18f2edae0.
Reason for revert: Experimental revert to see if this is blocking the roll
Original change's description:
> Remove origin field from GrSurface
>
> 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.
>
> Change-Id: Iabd79ae98b227b5b9409f3ab5bbcc48af9613c18
> Reviewed-on: https://skia-review.googlesource.com/26363
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
TBR=bsalomon@google.com,robertphillips@google.com
Change-Id: Id606aa01e84e2b83be71d833eefca477c1ad0d01
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/29220
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index cd8aa7b..347f0b5 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -433,7 +433,7 @@
GrGpu::DrawPreference drawPreference = premulOnGpu ? GrGpu::kCallerPrefersDraw_DrawPreference
: GrGpu::kNoDraw_DrawPreference;
GrGpu::WritePixelTempDrawInfo tempDrawInfo;
- if (!fContext->fGpu->getWritePixelsInfo(dstSurface, dstProxy->origin(), width, height,
+ if (!fContext->fGpu->getWritePixelsInfo(dstSurface, width, height,
srcConfig, &drawPreference, &tempDrawInfo)) {
return false;
}
@@ -486,8 +486,8 @@
return false;
}
GrTexture* texture = tempProxy->priv().peekTexture();
- if (!fContext->fGpu->writePixels(texture, tempProxy->origin(), 0, 0, width, height,
- tempDrawInfo.fWriteConfig, buffer, rowBytes)) {
+ if (!fContext->fGpu->writePixels(texture, 0, 0, width, height, tempDrawInfo.fWriteConfig,
+ buffer, rowBytes)) {
return false;
}
SkMatrix matrix;
@@ -509,8 +509,8 @@
this->flushSurfaceWrites(renderTargetContext->asRenderTargetProxy());
}
} else {
- return fContext->fGpu->writePixels(dstSurface, dstProxy->origin(), left, top, width,
- height, srcConfig, buffer, rowBytes);
+ return fContext->fGpu->writePixels(dstSurface, left, top, width, height, srcConfig,
+ buffer, rowBytes);
}
return true;
}
@@ -564,7 +564,7 @@
GrGpu::DrawPreference drawPreference = unpremulOnGpu ? GrGpu::kCallerPrefersDraw_DrawPreference
: GrGpu::kNoDraw_DrawPreference;
GrGpu::ReadPixelTempDrawInfo tempDrawInfo;
- if (!fContext->fGpu->getReadPixelsInfo(srcSurface, srcProxy->origin(), width, height, rowBytes,
+ if (!fContext->fGpu->getReadPixelsInfo(srcSurface, width, height, rowBytes,
dstConfig, &drawPreference, &tempDrawInfo)) {
return false;
}
@@ -641,7 +641,7 @@
this->flushSurfaceWrites(proxyToRead.get());
configToRead = tempDrawInfo.fReadConfig;
}
- if (!fContext->fGpu->readPixels(surfaceToRead, proxyToRead->origin(),
+ if (!fContext->fGpu->readPixels(surfaceToRead,
left, top, width, height, configToRead, buffer, rowBytes)) {
return false;
}
@@ -742,8 +742,7 @@
sk_sp<SkColorSpace> colorSpace) {
ASSERT_SINGLE_OWNER_PRIV
- SkASSERT(kDefault_GrSurfaceOrigin != origin);
- sk_sp<GrSurface> surface(fContext->resourceProvider()->wrapBackendTexture(tex));
+ sk_sp<GrSurface> surface(fContext->resourceProvider()->wrapBackendTexture(tex, origin));
if (!surface) {
return nullptr;
}
@@ -764,10 +763,8 @@
const SkSurfaceProps* props) {
ASSERT_SINGLE_OWNER_PRIV
- SkASSERT(kDefault_GrSurfaceOrigin != origin);
-
sk_sp<GrSurface> surface(
- fContext->resourceProvider()->wrapRenderableBackendTexture(tex, sampleCnt));
+ fContext->resourceProvider()->wrapRenderableBackendTexture(tex, origin, sampleCnt));
if (!surface) {
return nullptr;
}
@@ -788,8 +785,8 @@
const SkSurfaceProps* surfaceProps) {
ASSERT_SINGLE_OWNER_PRIV
- SkASSERT(kDefault_GrSurfaceOrigin != origin);
- sk_sp<GrRenderTarget> rt(fContext->resourceProvider()->wrapBackendRenderTarget(backendRT));
+ sk_sp<GrRenderTarget> rt(fContext->resourceProvider()->wrapBackendRenderTarget(backendRT,
+ origin));
if (!rt) {
return nullptr;
}
@@ -812,9 +809,9 @@
const SkSurfaceProps* surfaceProps) {
ASSERT_SINGLE_OWNER_PRIV
- SkASSERT(kDefault_GrSurfaceOrigin != origin);
sk_sp<GrSurface> surface(fContext->resourceProvider()->wrapBackendTextureAsRenderTarget(
tex,
+ origin,
sampleCnt));
if (!surface) {
return nullptr;