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

Unified Diff: include/core/SkTemplates.h

Issue 1055743003: Swizzler changes Index8 and 565 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Gif rewinding that actually works Created 5 years, 8 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
Index: include/core/SkTemplates.h
diff --git a/include/core/SkTemplates.h b/include/core/SkTemplates.h
index 1d22a642dae3ba959d4f7a9a9bee8fb4ff7072e7..a8b276950d91dc3e413eda568f6c6bfbc65fe40f 100644
--- a/include/core/SkTemplates.h
+++ b/include/core/SkTemplates.h
@@ -112,6 +112,14 @@ public:
T* operator->() const { SkASSERT(fObj); return fObj; }
T* detach() { T* obj = fObj; fObj = NULL; return obj; }
+ void reset(T* obj = NULL) {
+ if (fObj != obj) {
+ if (fObj) {
+ P(fObj);
+ }
+ fObj = obj;
+ }
+ }
msarett 2015/04/09 16:26:32 I'm sure it is possible to implement gif rewinding
scroggo 2015/04/09 17:37:17 git blame is your friend. Using blame, I see we ad
msarett 2015/04/09 19:21:31 All good points. Seems like using SkAutoTCallCPro
private:
T* fObj;
};
« no previous file with comments | « gyp/tests.gypi ('k') | src/codec/SkCodec_libbmp.h » ('j') | src/codec/SkCodec_libgif.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698