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

Unified Diff: src/core/SkImageCacherator.h

Issue 2453473004: Avoid separate allocation of SkImageCacherator (Closed)
Patch Set: pass validator to ctor Created 4 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 | « no previous file | src/core/SkImageCacherator.cpp » ('j') | src/image/SkImage_Generator.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkImageCacherator.h
diff --git a/src/core/SkImageCacherator.h b/src/core/SkImageCacherator.h
index 3be69a5785686e811e2a0c2e4c151d6cbeeaf95c..2d9e94cc4d7f9bc7b1e3a439f69eebe3a636b800 100644
--- a/src/core/SkImageCacherator.h
+++ b/src/core/SkImageCacherator.h
@@ -68,7 +68,18 @@ public:
int srcX, int srcY);
private:
- SkImageCacherator(SkImageGenerator*, const SkImageInfo&, const SkIPoint&, uint32_t uniqueID);
+ struct Validator {
+ Validator(SkImageGenerator*, const SkIRect* subset);
+
+ operator bool() const { return fGenerator.get(); }
+
+ std::unique_ptr<SkImageGenerator> fGenerator;
+ SkImageInfo fInfo;
+ SkIPoint fOrigin;
+ uint32_t fUniqueID;
+ };
+
+ SkImageCacherator(Validator*);
bool generateBitmap(SkBitmap*);
bool tryLockAsBitmap(SkBitmap*, const SkImage*, SkImage::CachingHint);
@@ -100,6 +111,8 @@ private:
const uint32_t fUniqueID;
friend class GrImageTextureMaker;
+ friend class SkImage;
+ friend class SkImage_Generator;
};
#endif
« no previous file with comments | « no previous file | src/core/SkImageCacherator.cpp » ('j') | src/image/SkImage_Generator.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698