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

Unified Diff: src/gpu/GrImageIDTextureAdjuster.h

Issue 1510903002: Stop wrapping images backed by generators as bitmaps in SkGpuDevice (except when tiling) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: comment Created 5 years 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/core/SkImageCacherator.cpp ('k') | src/gpu/GrImageIDTextureAdjuster.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrImageIDTextureAdjuster.h
diff --git a/src/gpu/GrImageIDTextureAdjuster.h b/src/gpu/GrImageIDTextureAdjuster.h
index a20902ed581fb1fa6b2eef6696df53bb0cefc4c1..d8510feeaaff292e030db70eb3a89c66ca375574 100644
--- a/src/gpu/GrImageIDTextureAdjuster.h
+++ b/src/gpu/GrImageIDTextureAdjuster.h
@@ -9,9 +9,11 @@
#define GrImageIDTextureAdjuster_DEFINED
#include "GrTextureParamsAdjuster.h"
+#include "SkImage.h"
class SkBitmap;
class SkImage_Base;
+class SkImageCacherator;
/** Implementation for texture-backed SkBitmaps. The bitmap must stay in scope and unmodified
while this object exists. */
@@ -66,4 +68,29 @@ private:
typedef GrTextureMaker INHERITED;
};
+/** This class manages the conversion of generator-backed images to GrTextures. If the caching hint
+ is kAllow the image's ID is used for the cache key. */
+class GrImageTextureMaker : public GrTextureMaker {
+public:
+ GrImageTextureMaker(GrContext* context, SkImageCacherator* cacher, const SkImage* client,
+ SkImage::CachingHint chint);
+
+protected:
+ // TODO: consider overriding this, for the case where the underlying generator might be
+ // able to efficiently produce a "stretched" texture natively (e.g. picture-backed)
+ // GrTexture* generateTextureForParams(const CopyParams&) override;
+
+ GrTexture* refOriginalTexture() override;
+ void makeCopyKey(const CopyParams& stretch, GrUniqueKey* paramsCopyKey) override;
+ void didCacheCopy(const GrUniqueKey& copyKey) override;
+
+private:
+ SkImageCacherator* fCacher;
+ const SkImage* fClient;
+ GrUniqueKey fOriginalKey;
+ SkImage::CachingHint fCachingHint;
+
+ typedef GrTextureMaker INHERITED;
+};
+
#endif
« no previous file with comments | « src/core/SkImageCacherator.cpp ('k') | src/gpu/GrImageIDTextureAdjuster.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698