aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrBackendTextureImageGenerator.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-08-01 13:51:44 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-08-01 13:51:54 +0000
commit7294b851d277d8e703b23657e1a990f1ae24ead6 (patch)
treeb042db82a0b5bf61d0f453d404dbdeab2f8e3a47 /src/gpu/GrBackendTextureImageGenerator.cpp
parentac32662d128484eae3230653e3794a6f33dd9f5b (diff)
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>
Diffstat (limited to 'src/gpu/GrBackendTextureImageGenerator.cpp')
-rw-r--r--src/gpu/GrBackendTextureImageGenerator.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/gpu/GrBackendTextureImageGenerator.cpp b/src/gpu/GrBackendTextureImageGenerator.cpp
index 22cdec395a..ac4fee37ac 100644
--- a/src/gpu/GrBackendTextureImageGenerator.cpp
+++ b/src/gpu/GrBackendTextureImageGenerator.cpp
@@ -54,8 +54,7 @@ static GrBackendTexture make_backend_texture_from_handle(GrBackend backend,
}
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 @@ GrBackendTextureImageGenerator::Make(sk_sp<GrTexture> texture, GrSurfaceOrigin o
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 @@ GrBackendTextureImageGenerator::GrBackendTextureImageGenerator(const SkImageInfo
, fSemaphore(std::move(semaphore))
, fLastBorrowingContextID(SK_InvalidGenID)
, fBackendTexture(backendTex)
- , fSurfaceOrigin(origin) { }
+ , fSurfaceOrigin(texture->origin()) { }
GrBackendTextureImageGenerator::~GrBackendTextureImageGenerator() {
fRefHelper->unref();
@@ -148,13 +146,12 @@ sk_sp<GrTextureProxy> GrBackendTextureImageGenerator::onGenerateTexture(
}
}
- 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;