aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrDrawingManager.cpp
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-06-20 16:25:26 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-20 21:13:27 +0000
commit930f939c48af1be6005af12bb6f709ca5da9d118 (patch)
tree21dbb8b105aa1190237c148358b7993565158335 /src/gpu/GrDrawingManager.cpp
parent2a284de7a51c198096a6f34ec1cbfe9118db554c (diff)
Ensure that textures exported via SkImage::MakeBackendTextureFromSkImage
have consistent content in their mip map levels. Bug= chromium:850617 Change-Id: I3ad918aa453bd8e4e625eb145de6ba2a5dab7b0c Reviewed-on: https://skia-review.googlesource.com/136230 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/GrDrawingManager.cpp')
-rw-r--r--src/gpu/GrDrawingManager.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp
index 7c6338f3d2..2b8c26213d 100644
--- a/src/gpu/GrDrawingManager.cpp
+++ b/src/gpu/GrDrawingManager.cpp
@@ -19,14 +19,16 @@
#include "GrResourceProvider.h"
#include "GrSoftwarePathRenderer.h"
#include "GrSurfaceProxyPriv.h"
+#include "GrTexture.h"
#include "GrTextureContext.h"
#include "GrTextureOpList.h"
+#include "GrTexturePriv.h"
#include "GrTextureProxy.h"
#include "GrTextureProxyPriv.h"
+#include "GrTracing.h"
#include "SkDeferredDisplayList.h"
#include "SkSurface_Gpu.h"
#include "SkTTopoSort.h"
-#include "GrTracing.h"
#include "ccpr/GrCoverageCountingPathRenderer.h"
#include "text/GrTextContext.h"
@@ -377,8 +379,14 @@ GrSemaphoresSubmitted GrDrawingManager::prepareSurfaceForExternalIO(
}
GrSurface* surface = proxy->priv().peekSurface();
- if (surface->asRenderTarget()) {
- gpu->resolveRenderTarget(surface->asRenderTarget());
+ if (auto* rt = surface->asRenderTarget()) {
+ gpu->resolveRenderTarget(rt);
+ }
+ if (auto* tex = surface->asTexture()) {
+ if (tex->texturePriv().mipMapped() == GrMipMapped::kYes &&
+ tex->texturePriv().mipMapsAreDirty()) {
+ gpu->regenerateMipMapLevels(tex);
+ }
}
return result;
}