From 6668a514ac5d507359a885480cbaabd812ef92db Mon Sep 17 00:00:00 2001 From: Mike Klein Date: Wed, 25 Jul 2018 18:38:50 +0000 Subject: Revert "Go back to cleaning up MIP levels on texture export rather than assuming dirty" This reverts commit 01d6fc9d8415e400a7eac95518356ecf341aa5cb. Reason for revert: layout tests. Original change's description: > Go back to cleaning up MIP levels on texture export rather than assuming dirty > on texture import. > > Bug: skia:8155 > Change-Id: I23399f442d52c73906829132f798eda260b6d4ae > Reviewed-on: https://skia-review.googlesource.com/143291 > Auto-Submit: Brian Salomon > Commit-Queue: Brian Osman > Reviewed-by: Brian Osman TBR=bsalomon@google.com,brianosman@google.com Change-Id: Ice4cb4e253e52d67eb8bd6e2a12ccc844b7bfa8d No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:8155 Reviewed-on: https://skia-review.googlesource.com/143380 Reviewed-by: Mike Klein Commit-Queue: Mike Klein --- src/gpu/GrDrawingManager.cpp | 4 ++++ src/image/SkImage_Gpu.cpp | 11 +++++++++++ 2 files changed, 15 insertions(+) (limited to 'src') diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp index e3e7a9cba3..8b0fb22f6b 100644 --- a/src/gpu/GrDrawingManager.cpp +++ b/src/gpu/GrDrawingManager.cpp @@ -375,12 +375,16 @@ GrSemaphoresSubmitted GrDrawingManager::prepareSurfaceForExternalIO( if (auto* rt = surface->asRenderTarget()) { gpu->resolveRenderTarget(rt); } +#if 0 + // This is temporarily is disabled. See comment in SkImage_Gpu.cpp, + // new_wrapped_texture_common(). if (auto* tex = surface->asTexture()) { if (tex->texturePriv().mipMapped() == GrMipMapped::kYes && tex->texturePriv().mipMapsAreDirty()) { gpu->regenerateMipMapLevels(tex); } } +#endif return result; } diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp index 1dea80659a..1d5ca96848 100644 --- a/src/image/SkImage_Gpu.cpp +++ b/src/image/SkImage_Gpu.cpp @@ -290,6 +290,17 @@ static sk_sp new_wrapped_texture_common(GrContext* ctx, if (!proxy) { return nullptr; } +#if 1 + // Temporary fix for crbug.com/850617 that can be cleanly merged back to older branches. Assume + // any MIP levels on the incoming texture are dirty. The proper fix is to make them clean on + // export. See #if 0'ed out code in GrDrawingManager::prepareSurfaceForExternalIO(). + SkASSERT(proxy->priv().isInstantiated()); + if (auto* tex = proxy->priv().peekTexture()) { + if (tex->texturePriv().mipMapped() == GrMipMapped::kYes) { + proxy->priv().peekTexture()->texturePriv().markMipMapsDirty(); + } + } +#endif return sk_make_sp(sk_ref_sp(ctx), kNeedNewImageUniqueID, at, std::move(proxy), std::move(colorSpace), SkBudgeted::kNo); } -- cgit v1.2.3