Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Unified Diff: src/gpu/GrTextureParamsAdjuster.cpp

Issue 2066493006: Check for abandoned texture in GrTextureAdjuster::refTextureSafeForParams (Closed) Base URL: https://chromium.googlesource.com/skia.git@m52
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTextureParamsAdjuster.cpp
diff --git a/src/gpu/GrTextureParamsAdjuster.cpp b/src/gpu/GrTextureParamsAdjuster.cpp
index a91ba8a5e37e65199944393bc30767d60c919cbc..1d061375d9e70cc6469de644e72002f1d2c405f4 100644
--- a/src/gpu/GrTextureParamsAdjuster.cpp
+++ b/src/gpu/GrTextureParamsAdjuster.cpp
@@ -164,6 +164,11 @@ GrTexture* GrTextureAdjuster::refTextureSafeForParams(const GrTextureParams& par
CopyParams copyParams;
const SkIRect* contentArea = this->contentAreaOrNull();
+ if (!context) {
+ // The texture was abandoned.
+ return nullptr;
+ }
+
if (contentArea && GrTextureParams::kMipMap_FilterMode == params.filterMode()) {
// If we generate a MIP chain for texture it will read pixel values from outside the content
// area.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698