Reland "Go back to cleaning up MIP levels on texture export rather than assuming dirty on texture import."

This is a reland of 01d6fc9d84
Chrome layout tests have been suppressed so this shouldn't block a Skia roll.

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 <bsalomon@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

Bug: skia:8155
Change-Id: Ia3843b66c2453daf15e566b7ecf890c2ff4aed22
Reviewed-on: https://skia-review.googlesource.com/143960
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This commit is contained in:
Brian Salomon 2018-07-25 08:52:32 -07:00 committed by Skia Commit-Bot
parent da1be46e24
commit 504dd052b9
3 changed files with 0 additions and 21 deletions

View File

@ -380,16 +380,12 @@ 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;
}

View File

@ -290,17 +290,6 @@ static sk_sp<SkImage> 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<SkImage_Gpu>(sk_ref_sp(ctx), kNeedNewImageUniqueID, at, std::move(proxy),
std::move(colorSpace), SkBudgeted::kNo);
}

View File

@ -87,13 +87,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrWrappedMipMappedTest, reporter, ctxInfo) {
if (isRT) {
REPORTER_ASSERT(reporter, texture->texturePriv().mipMapsAreDirty());
} else {
#if 1
// This is temporarily checks that the new image DOES have dirty MIP levels. See
// comment in SkImage_Gpu.cpp, new_wrapped_texture_common().
REPORTER_ASSERT(reporter, texture->texturePriv().mipMapsAreDirty());
#else
REPORTER_ASSERT(reporter, !texture->texturePriv().mipMapsAreDirty());
#endif
}
} else {
REPORTER_ASSERT(reporter, GrMipMapped::kNo == texture->texturePriv().mipMapped());