diff options
author | 2013-04-01 12:49:31 +0000 | |
---|---|---|
committer | 2013-04-01 12:49:31 +0000 | |
commit | bb5c46591c50d05418467cd1c4e927ceb85c2ba9 (patch) | |
tree | a82f0f7b695901adfffa91721b29238803c8cb84 /include/core/SkTLazy.h | |
parent | d55846d100bb09448b398b41798bd4ab100a753a (diff) |
Trim the copy of the dst made for dst-reading effects using the clip and dev-bounds of draw.
Adds dev bounds to circles and rects drawn by GrDrawTarget base class (GrIODB already provides rect bounds).
Author: bsalomon@google.com
Reviewed By: robertphilips@google.com,jvanverth@google.com,robertphillips@google.com
Review URL: https://chromiumcodereview.appspot.com/13222004
git-svn-id: http://skia.googlecode.com/svn/trunk@8453 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core/SkTLazy.h')
-rw-r--r-- | include/core/SkTLazy.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/core/SkTLazy.h b/include/core/SkTLazy.h index 2fe05f1db1..0daf98caa7 100644 --- a/include/core/SkTLazy.h +++ b/include/core/SkTLazy.h @@ -81,10 +81,16 @@ public: bool isValid() const { return NULL != fPtr; } /** - * Returns either NULL, or a copy of the object that was passed to - * set() or the constructor. + * Returns the object. This version should only be called when the caller + * knows that the object has been initialized. */ T* get() const { SkASSERT(this->isValid()); return fPtr; } + + /** + * Like above but doesn't assert if object isn't initialized (in which case + * NULL is returned). + */ + T* getMaybeNull() const { return fPtr; } private: friend void* operator new<T>(size_t, SkTLazy* lazy); |