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

Unified Diff: src/image/SkImage_Raster.cpp

Issue 1411353002: Revert recent CLs around GrTextureMaker/GrTextureParamsAdjuster (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 2 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 | « src/image/SkImage_Gpu.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImage_Raster.cpp
diff --git a/src/image/SkImage_Raster.cpp b/src/image/SkImage_Raster.cpp
index 9c90ba908b1fdc46b0b5ea7357636919d71e7216..b78818db6b71fd4aaadf8eafac5920817824b066 100644
--- a/src/image/SkImage_Raster.cpp
+++ b/src/image/SkImage_Raster.cpp
@@ -173,6 +173,20 @@ GrTexture* SkImage_Raster::asTextureRef(GrContext* ctx, const GrTextureParams& p
return nullptr;
}
+ // textures (at least the texture-key) only support 16bit dimensions, so abort early
+ // if we're too big.
+ if (fBitmap.width() > 0xFFFF || fBitmap.height() > 0xFFFF) {
+ return nullptr;
+ }
+
+ GrUniqueKey key;
+ GrMakeKeyFromImageID(&key, fBitmap.getGenerationID(),
+ SkIRect::MakeWH(fBitmap.width(), fBitmap.height()),
+ *ctx->caps(), params);
+
+ if (GrTexture* tex = ctx->textureProvider()->findAndRefTextureByUniqueKey(key)) {
+ return tex;
+ }
return GrRefCachedBitmapTexture(ctx, fBitmap, params);
#endif
« no previous file with comments | « src/image/SkImage_Gpu.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698