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/GrBackendTextureImageGenerator.cpp b/src/gpu/GrBackendTextureImageGenerator.cpp
index 22cdec3..ac4fee3 100644
--- a/src/gpu/GrBackendTextureImageGenerator.cpp
+++ b/src/gpu/GrBackendTextureImageGenerator.cpp
@@ -54,8 +54,7 @@
}
std::unique_ptr<SkImageGenerator>
-GrBackendTextureImageGenerator::Make(sk_sp<GrTexture> texture, GrSurfaceOrigin origin,
- sk_sp<GrSemaphore> semaphore,
+GrBackendTextureImageGenerator::Make(sk_sp<GrTexture> texture, sk_sp<GrSemaphore> semaphore,
SkAlphaType alphaType, sk_sp<SkColorSpace> colorSpace) {
if (colorSpace && (!colorSpace->gammaCloseToSRGB() && !colorSpace->gammaIsLinear())) {
return nullptr;
@@ -83,12 +82,11 @@
SkImageInfo info = SkImageInfo::Make(texture->width(), texture->height(), colorType, alphaType,
std::move(colorSpace));
return std::unique_ptr<SkImageGenerator>(new GrBackendTextureImageGenerator(
- info, texture.get(), origin, context->uniqueID(), std::move(semaphore), backendTexture));
+ info, texture.get(), context->uniqueID(), std::move(semaphore), backendTexture));
}
GrBackendTextureImageGenerator::GrBackendTextureImageGenerator(const SkImageInfo& info,
GrTexture* texture,
- GrSurfaceOrigin origin,
uint32_t owningContextID,
sk_sp<GrSemaphore> semaphore,
const GrBackendTexture& backendTex)
@@ -97,7 +95,7 @@
, fSemaphore(std::move(semaphore))
, fLastBorrowingContextID(SK_InvalidGenID)
, fBackendTexture(backendTex)
- , fSurfaceOrigin(origin) { }
+ , fSurfaceOrigin(texture->origin()) { }
GrBackendTextureImageGenerator::~GrBackendTextureImageGenerator() {
fRefHelper->unref();
@@ -148,13 +146,12 @@
}
}
- SkASSERT(kDefault_GrSurfaceOrigin != fSurfaceOrigin);
// We just gained access to the texture. If we're on the original context, we could use the
// original texture, but we'd have no way of detecting that it's no longer in-use. So we
// always make a wrapped copy, where the release proc informs us that the context is done
// with it. This is unfortunate - we'll have two texture objects referencing the same GPU
// object. However, no client can ever see the original texture, so this should be safe.
- tex = context->resourceProvider()->wrapBackendTexture(fBackendTexture,
+ tex = context->resourceProvider()->wrapBackendTexture(fBackendTexture, fSurfaceOrigin,
kBorrow_GrWrapOwnership);
if (!tex) {
fRefHelper->fBorrowingContextID = SK_InvalidGenID;